- Timestamp:
- Mar 29, 2019 12:50:41 PM (22 months ago)
- Branches:
- master
- Children:
- 7501e3f
- Parents:
- ba801be
- Location:
- core/java/src/net/i2p
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
core/java/src/net/i2p/crypto/Blinding.java
rba801be reb0920e2 219 219 * 220 220 * @param b 35+ bytes 221 * @return BlindData structure, use getUnblindedPubKey() for the result 221 222 * @throws IllegalArgumentException on bad inputs 222 223 * @throws UnsupportedOperationException unless supported SigTypes … … 314 315 } 315 316 317 public static void main(String args[]) throws Exception { 318 if (args.length != 1) { 319 System.out.println("Usage: blinding {56 chars}.b32.i2p"); 320 System.exit(1); 321 } 322 System.out.println("Blinded B32: " + args[0]); 323 System.out.println(decode(I2PAppContext.getGlobalContext(), args[0]).toString()); 324 } 325 316 326 /****** 317 327 public static void main(String args[]) throws Exception { -
core/java/src/net/i2p/data/BlindData.java
rba801be reb0920e2 43 43 _blindType = blindType; 44 44 _secret = secret; 45 _authType = 0;45 _authType = -1; 46 46 _authKey = null; 47 47 // defer until needed … … 54 54 public SigningPublicKey getUnblindedPubKey() { 55 55 return _clearSPK; 56 } 57 58 /** 59 * @return The type of the blinded key 60 */ 61 public SigType getBlindedSigType() { 62 return _blindType; 56 63 } 57 64 … … 116 123 117 124 /** 118 * @return 0for no client auth125 * @return -1 for no client auth 119 126 */ 120 127 public int getAuthType() { 121 128 return _authType; 129 } 130 131 /** 132 * @return null for no client auth 133 */ 134 public PrivateKey getAuthPrivKey() { 135 return _authKey; 122 136 } 123 137 … … 148 162 public synchronized String toString() { 149 163 calculate(); 150 StringBuilder buf = new StringBuilder( 256);164 StringBuilder buf = new StringBuilder(1024); 151 165 buf.append("[BlindData: "); 152 166 buf.append("\n\tSigningPublicKey: ").append(_clearSPK); … … 154 168 buf.append("\n\tBlindedPublicKey: ").append(_blindSPK); 155 169 buf.append("\n\tBlinded Hash : ").append(_blindHash); 156 buf.append("\n\tSecret: ").append(_secret); 170 if (_secret != null) 171 buf.append("\n\tSecret : \"").append(_secret).append('"'); 172 buf.append("\n\tAuth Type : "); 173 if (_authType >= 0) 174 buf.append(_authType); 175 else 176 buf.append("none"); 177 if (_authKey != null) 178 buf.append("\n\tAuth Key : ").append(_authKey); 157 179 if (_dest != null) 158 180 buf.append("\n\tDestination: ").append(_dest); 159 if (_dest != null)181 else 160 182 buf.append("\n\tDestination: unknown"); 161 183 buf.append(']');
Note: See TracChangeset
for help on using the changeset viewer.