propagate from branch 'i2p.i2p' (head 5b1c8cca17ce959d164a3d3d95453124211fb41d)

to branch 'i2p.i2p.zzz.test' (head e118104e3601f3c56d3a84594fb35de6d902da8f)
This commit is contained in:
zzz
2009-08-30 16:06:46 +00:00
6 changed files with 37 additions and 15 deletions

View File

@ -388,9 +388,13 @@ public class I2PAppContext {
* The session key manager which coordinates the sessionKey / sessionTag
* data. This component allows transparent operation of the
* ElGamal/AES+SessionTag algorithm, and contains all of the session tags
* for one particular application. If you want to seperate multiple apps
* to have their own sessionTags and sessionKeys, they should use different
* I2PAppContexts, and hence, different sessionKeyManagers.
* for one particular application.
*
* This is deprecated for client use, it should be used only by the router
* as its own key manager. Not that clients are doing end-to-end crypto anyway.
*
* For client crypto within the router,
* use RouterContext.clientManager.getClientSessionKeyManager(dest)
*
*/
public SessionKeyManager sessionKeyManager() {

View File

@ -59,14 +59,18 @@ public class ElGamalAESEngine {
}
/**
* Decrypt the message using the given private key using tags from the given key manager.
* Decrypt the message using the given private key using tags from the default key manager.
*
* @deprecated specify the key manager!
*/
public byte[] decrypt(byte data[], PrivateKey targetPrivateKey) throws DataFormatException {
return decrypt(data, targetPrivateKey, _context.sessionKeyManager());
}
/**
* Decrypt the message using the given private key. This works according to the
* Decrypt the message using the given private key
* and using tags from the specified key manager.
* This works according to the
* ElGamal+AES algorithm in the data structure spec.
*
*/

View File

@ -89,6 +89,8 @@ public class SessionKey extends DataStructureImpl {
@Override
public String toString() {
return "SessionKey " + toBase64();
/****
if (true) return super.toString();
StringBuilder buf = new StringBuilder(64);
buf.append("[SessionKey: ");
@ -103,5 +105,6 @@ public class SessionKey extends DataStructureImpl {
}
buf.append("]");
return buf.toString();
****/
}
}

View File

@ -58,4 +58,8 @@ public class SessionTag extends ByteArray {
out.write(getData());
}
}
@Override
public String toString() {
return "SessionTag " + toBase64();
}
}