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 and Description
    --- | ---
    `static String` | `DEFAULT_KEYDIR`
    `static String` | `PROP_KEYDIR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KeyManager(RouterContext context)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `LeaseSetKeys` | `getKeys(Destination dest)`
    `LeaseSetKeys` | `getKeys(Hash dest)`
    `PrivateKey` | `getPrivateKey()`
    `PublicKey` | `getPublicKey()`
    `SigningPrivateKey` | `getSigningPrivateKey()`
    `SigningPublicKey` | `getSigningPublicKey()`
    `void` | `registerKeys(Destination dest, SigningPrivateKey leaseRevocationPrivateKey, PrivateKey endpointDecryptionKey)`
    `void` | `setPrivateKey(PrivateKey key)` Configure the router's private key
    `void` | `setPublicKey(PublicKey key)` Configure the router's public key
    `void` | `setSigningPrivateKey(SigningPrivateKey key)` Configure the router's signing private key
    `void` | `setSigningPublicKey(SigningPublicKey key)` Configure the router's signing public key
    `void` | `startup()`
    `LeaseSetKeys` | `unregisterKeys(Destination dest)`

    - ### 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

  - ### Constructor Detail

    - #### KeyManager

          public KeyManager(RouterContext context)

  - ### Method Detail

    - #### startup

          public void startup()

    - #### setPrivateKey

          public void setPrivateKey(PrivateKey key)

      Configure the router's private key

    - #### getPrivateKey

          public PrivateKey getPrivateKey()

    - #### setPublicKey

          public void setPublicKey(PublicKey key)

      Configure the router's public key

    - #### getPublicKey

          public PublicKey getPublicKey()

    - #### setSigningPrivateKey

          public void setSigningPrivateKey(SigningPrivateKey key)

      Configure the router's signing private key

    - #### getSigningPrivateKey

          public SigningPrivateKey getSigningPrivateKey()

    - #### setSigningPublicKey

          public void setSigningPublicKey(SigningPublicKey key)

      Configure the router's signing public key

    - #### getSigningPublicKey

          public SigningPublicKey getSigningPublicKey()

    - #### registerKeys

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

    - #### unregisterKeys

          public LeaseSetKeys unregisterKeys(Destination dest)

    - #### getKeys

          public LeaseSetKeys getKeys(Destination dest)

    - #### getKeys

          public LeaseSetKeys getKeys(Hash dest)