Package net.i2p.router
Class KeyManager
java.lang.Object
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
Fields Modifier and Type Field Description static StringDEFAULT_KEYDIRstatic StringKEYFILE_PRIVATE_ENCstatic StringKEYFILE_PRIVATE_SIGNINGstatic StringKEYFILE_PUBLIC_ENCstatic StringKEYFILE_PUBLIC_SIGNINGstatic StringPROP_KEYDIR -
Constructor Summary
Constructors Constructor Description KeyManager(RouterContext context) -
Method Summary
Modifier and Type Method Description LeaseSetKeysgetKeys(Destination dest)clientLeaseSetKeysgetKeys(Hash dest)clientPrivateKeygetPrivateKey()Router keyPublicKeygetPublicKey()Router keySigningPrivateKeygetSigningPrivateKey()Router keySigningPublicKeygetSigningPublicKey()Router keyvoidregisterKeys(Destination dest, SigningPrivateKey leaseRevocationPrivateKey, List<PrivateKey> endpointDecryptionKeys)Client with multiple keysvoidregisterKeys(Destination dest, SigningPrivateKey leaseRevocationPrivateKey, PrivateKey endpointDecryptionKey)Client with a single keyvoidsetKeys(PublicKey key1, PrivateKey key2, SigningPublicKey key3, SigningPrivateKey key4)Configure the router's keys.voidstartup()Deprecated.we never read keys in anymoreLeaseSetKeysunregisterKeys(Destination dest)client
-
Field Details
-
PROP_KEYDIR
- See Also:
- Constant Field Values
-
DEFAULT_KEYDIR
- See Also:
- Constant Field Values
-
KEYFILE_PRIVATE_ENC
- See Also:
- Constant Field Values
-
KEYFILE_PUBLIC_ENC
- See Also:
- Constant Field Values
-
KEYFILE_PRIVATE_SIGNING
- See Also:
- Constant Field Values
-
KEYFILE_PUBLIC_SIGNING
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
startup
Deprecated.we never read keys in anymoreRead 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
Router key- Returns:
- will be null on error or before startup() or setKeys() is called
-
getPublicKey
Router key- Returns:
- will be null on error or before startup() or setKeys() is called
-
getSigningPrivateKey
Router key- Returns:
- will be null on error or before startup() or setKeys() is called
-
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 with a single key- Parameters:
leaseRevocationPrivateKey- unused, may be null
-
registerKeys
public void registerKeys(Destination dest, SigningPrivateKey leaseRevocationPrivateKey, List<PrivateKey> endpointDecryptionKeys)Client with multiple keys- Parameters:
leaseRevocationPrivateKey- unused, may be null- Since:
- 0.9.44
-
unregisterKeys
client -
getKeys
client -
getKeys
client
-