java.lang.Object
net.i2p.crypto.KeyPair
Direct Known Subclasses:
Elg2KeyPair

public class KeyPairextends Object
A pair of I2P cryptographic keys consisting of a public key and corresponding private key.

This class provides a type-safe container for I2P key pairs, similar to KeyPair but specifically designed for I2P's cryptographic operations including encryption, decryption, and digital signatures within the I2P network.

The public key is used for encryption and signature verification, while the private key is used for decryption and signing operations.

  • Field Details

    • pub

      private final PublicKey pub
      The public half of the pair.
    • priv

      private final PrivateKey priv
      The private half of the pair.
  • Constructor Details

    • KeyPair

      public KeyPair(PublicKey publicKey, PrivateKey privateKey)
      Non-null, same EncType as privateKey.
      Parameters:
      publicKey - non-null, same EncType as privateKey
      privateKey - non-null, same EncType as publicKey
  • Method Details

    • getPublic

      public PublicKey getPublic()
      Public key of this keypair.
      Returns:
      the public key
    • getPrivate

      public PrivateKey getPrivate()
      Private key of this keypair.
      Returns:
      the private key