net.i2p.router
Class KeyManager

java.lang.Object
  extended by net.i2p.router.KeyManager

public class KeyManager
extends Object

Maintain all of the key pairs for the router. Router keys are written to files in a backup directory. LeaseSet keys are not written to files.


Field Summary
static String DEFAULT_KEYDIR
           
static String KEYFILE_PRIVATE_ENC
           
static String KEYFILE_PRIVATE_SIGNING
           
static String KEYFILE_PUBLIC_ENC
           
static String KEYFILE_PUBLIC_SIGNING
           
static String PROP_KEYDIR
           
 
Constructor Summary
KeyManager(RouterContext context)
           
 
Method Summary
 LeaseSetKeys getKeys(Destination dest)
          client
 LeaseSetKeys getKeys(Hash dest)
          client
 PrivateKey getPrivateKey()
          Router key
 PublicKey getPublicKey()
          Router key
 SigningPrivateKey getSigningPrivateKey()
          Router key
 SigningPublicKey getSigningPublicKey()
          Router key
 void registerKeys(Destination dest, SigningPrivateKey leaseRevocationPrivateKey, PrivateKey endpointDecryptionKey)
          client
 void setKeys(PublicKey key1, PrivateKey key2, SigningPublicKey key3, SigningPrivateKey key4)
          Configure the router's keys.
 void startup()
          Deprecated. we never read keys in anymore
 LeaseSetKeys unregisterKeys(Destination dest)
          client
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_KEYDIR

public static final String PROP_KEYDIR
See Also:
Constant Field Values

DEFAULT_KEYDIR

public static final String DEFAULT_KEYDIR
See Also:
Constant Field Values

KEYFILE_PRIVATE_ENC

public static final String KEYFILE_PRIVATE_ENC
See Also:
Constant Field Values

KEYFILE_PUBLIC_ENC

public static final String KEYFILE_PUBLIC_ENC
See Also:
Constant Field Values

KEYFILE_PRIVATE_SIGNING

public static final String KEYFILE_PRIVATE_SIGNING
See Also:
Constant Field Values

KEYFILE_PUBLIC_SIGNING

public static final String KEYFILE_PUBLIC_SIGNING
See Also:
Constant Field Values
Constructor Detail

KeyManager

public KeyManager(RouterContext context)
Method Detail

startup

public void startup()
Deprecated. we never read keys in anymore

Read keys in from disk, blocking


setKeys

public void setKeys(PublicKey key1,
                    PrivateKey key2,
                    SigningPublicKey key3,
                    SigningPrivateKey key4)
Configure the router's keys.

Since:
0.9.4 replace individual setters

getPrivateKey

public PrivateKey getPrivateKey()
Router key

Returns:
will be null on error or before startup() or setKeys() is called

getPublicKey

public PublicKey getPublicKey()
Router key

Returns:
will be null on error or before startup() or setKeys() is called

getSigningPrivateKey

public SigningPrivateKey getSigningPrivateKey()
Router key

Returns:
will be null on error or before startup() or setKeys() is called

getSigningPublicKey

public SigningPublicKey getSigningPublicKey()
Router key

Returns:
will be null on error or before startup() or setKeys() is called

registerKeys

public void registerKeys(Destination dest,
                         SigningPrivateKey leaseRevocationPrivateKey,
                         PrivateKey endpointDecryptionKey)
client


unregisterKeys

public LeaseSetKeys unregisterKeys(Destination dest)
client


getKeys

public LeaseSetKeys getKeys(Destination dest)
client


getKeys

public LeaseSetKeys getKeys(Hash dest)
client