This commit is contained in:
zzz
2012-06-25 19:29:51 +00:00
parent ff0bfb9f12
commit 6c8c87b2dd
3 changed files with 12 additions and 4 deletions

View File

@ -61,7 +61,8 @@ public class ElGamalAESEngine {
}
/**
* Decrypt the message using the given private key using tags from the default key manager.
* Decrypt the message using the given private key using tags from the default key manager,
* which is the router's key manager. Use extreme care if you aren't the router.
*
* @deprecated specify the key manager!
*/
@ -75,6 +76,10 @@ public class ElGamalAESEngine {
* This works according to the
* ElGamal+AES algorithm in the data structure spec.
*
* Warning - use the correct SessionKeyManager. Clients should instantiate their own.
* Clients using I2PAppContext.sessionKeyManager() may be correlated with the router,
* unless you are careful to use different keys.
*
* @return decrypted data or null on failure
*/
public byte[] decrypt(byte data[], PrivateKey targetPrivateKey, SessionKeyManager keyManager) throws DataFormatException {

View File

@ -59,7 +59,8 @@ public class SessionKeyManager {
* Associate a new session key with the specified target. Metrics to determine
* when to expire that key begin with this call.
*
* @deprecated racy
* Racy if called after getCurrentKey() to check for a current session;
* use getCurrentOrNewKey() in that case.
*/
public void createSession(PublicKey target, SessionKey key) { // nop
}
@ -67,7 +68,8 @@ public class SessionKeyManager {
/**
* Generate a new session key and associate it with the specified target.
*
* @deprecated racy
* Racy if called after getCurrentKey() to check for a current session;
* use getCurrentOrNewKey() in that case.
*/
public SessionKey createSession(PublicKey target) {
SessionKey key = KeyGenerator.getInstance().generateSessionKey();

View File

@ -243,7 +243,8 @@ public class TransientSessionKeyManager extends SessionKeyManager {
* Associate a new session key with the specified target. Metrics to determine
* when to expire that key begin with this call.
*
* @deprecated racy
* Racy if called after getCurrentKey() to check for a current session;
* use getCurrentOrNewKey() in that case.
*/
@Override
public void createSession(PublicKey target, SessionKey key) {