net.i2p.router

## Class LeaseSetKeys

- java.lang.Object
- - net.i2p.router.LeaseSetKeys

-     public class LeaseSetKeys
      extends Object

  Wrap up the keys given to the router when a destination connects to it. Used by KeyManager, ClientMessageEventListener, GarlicMessageReceiver.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Set<EncType>` | `SET_BOTH` Unmodifiable, ElGamal and ECIES-X25519.
    `static Set<EncType>` | `SET_EC` Unmodifiable, ECIES-X25519 only
    `static Set<EncType>` | `SET_EC_PQ_ALL` Unmodifiable, ECIES-X25519 and PQ only
    `static Set<EncType>` | `SET_EC_PQ1` Unmodifiable, ECIES-X25519 and PQ only
    `static Set<EncType>` | `SET_EC_PQ2` Unmodifiable, ECIES-X25519 and PQ only
    `static Set<EncType>` | `SET_EC_PQ3` Unmodifiable, ECIES-X25519 and PQ only
    `static Set<EncType>` | `SET_ELG` Unmodifiable, ElGamal only
    `static Set<EncType>` | `SET_PQ1` Unmodifiable, PQ only
    `static Set<EncType>` | `SET_PQ2` Unmodifiable, PQ only
    `static Set<EncType>` | `SET_PQ3` Unmodifiable, PQ only

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LeaseSetKeys(Destination dest, SigningPrivateKey revocationKey, List<PrivateKey> decryptionKeys)` Client with multiple keys The ONLY valid combinations are X25519 + ElG or X25519 + (MLKEM512 OR MLKEM768 OR MLKEM1024).
    `LeaseSetKeys(Destination dest, SigningPrivateKey revocationKey, PrivateKey decryptionKey)` Client with a single key

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PrivateKey` | `getDecryptionKey()` Decryption key which can open up garlic messages encrypted to the LeaseSet's public key.
    `PrivateKey` | `getDecryptionKey(EncType type)` Decryption key which can open up garlic messages encrypted to the LeaseSet's public key.
    `PrivateKey` | `getPQDecryptionKey()`
    `SigningPrivateKey` | `getRevocationKey()` Key with which a LeaseSet can be revoked (by republishing it with no Leases) Deprecated, unused
    `Set<EncType>` | `getSupportedEncryption()` What types of encryption are supported?
    `boolean` | `isSupported(EncType type)` Do we support this type of encryption?

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SET_BOTH

          public static final Set<EncType> SET_BOTH

      Unmodifiable, ElGamal and ECIES-X25519.

    - #### SET_EC

          public static final Set<EncType> SET_EC

      Unmodifiable, ECIES-X25519 only

    - #### SET_EC_PQ_ALL

          public static final Set<EncType> SET_EC_PQ_ALL

      Unmodifiable, ECIES-X25519 and PQ only

    - #### SET_EC_PQ1

          public static final Set<EncType> SET_EC_PQ1

      Unmodifiable, ECIES-X25519 and PQ only

    - #### SET_EC_PQ2

          public static final Set<EncType> SET_EC_PQ2

      Unmodifiable, ECIES-X25519 and PQ only

    - #### SET_EC_PQ3

          public static final Set<EncType> SET_EC_PQ3

      Unmodifiable, ECIES-X25519 and PQ only

    - #### SET_ELG

          public static final Set<EncType> SET_ELG

      Unmodifiable, ElGamal only

    - #### SET_PQ1

          public static final Set<EncType> SET_PQ1

      Unmodifiable, PQ only

    - #### SET_PQ2

          public static final Set<EncType> SET_PQ2

      Unmodifiable, PQ only

    - #### SET_PQ3

          public static final Set<EncType> SET_PQ3

      Unmodifiable, PQ only

  - ### Constructor Detail

    - #### LeaseSetKeys

          public LeaseSetKeys(Destination dest,
                              SigningPrivateKey revocationKey,
                              List<PrivateKey> decryptionKeys)

      Client with multiple keys The ONLY valid combinations are X25519 + ElG or X25519 + (MLKEM512 OR MLKEM768 OR MLKEM1024). Other combinations will throw IllegalArgumentException.
      Parameters:
        `dest` - unused
        `revocationKey` - unused, may be null
        `decryptionKeys` - non-null, non-empty
      Throws:
        `IllegalArgumentException`

    - #### LeaseSetKeys

          public LeaseSetKeys(Destination dest,
                              SigningPrivateKey revocationKey,
                              PrivateKey decryptionKey)

      Client with a single key
      Parameters:
        `dest` - unused
        `revocationKey` - unused, may be null
        `decryptionKey` - non-null

  - ### Method Detail

    - #### getDecryptionKey

          public PrivateKey getDecryptionKey()

      Decryption key which can open up garlic messages encrypted to the LeaseSet's public key. This is used because the general public does not know on what router the destination is connected and as such can't encrypt to that router's normal public key.
      Returns:
        ElGamal key or null if the LS does not support ElGamal

    - #### getDecryptionKey

          public PrivateKey getDecryptionKey(EncType type)

      Decryption key which can open up garlic messages encrypted to the LeaseSet's public key. This is used because the general public does not know on what router the destination is connected and as such can't encrypt to that router's normal public key.
      Returns:
        key of the specified type or null if the LS does not support that type

    - #### getPQDecryptionKey

          public PrivateKey getPQDecryptionKey()

      Returns:
        PQ key (any type) or null if the LS does not support PQ

    - #### getRevocationKey

          public SigningPrivateKey getRevocationKey()

      Key with which a LeaseSet can be revoked (by republishing it with no Leases) Deprecated, unused

    - #### getSupportedEncryption

          public Set<EncType> getSupportedEncryption()

      What types of encryption are supported?

    - #### isSupported

          public boolean isSupported(EncType type)

      Do we support this type of encryption?