Class KeyPair

java.lang.Object
org.moera.lib.crypto.KeyPair

public class KeyPair extends Object
Represents a pair of cryptographic keys: a private key and a public key. This class is specifically designed for Elliptic Curve cryptography (EC).
  • Constructor Details

    • KeyPair

      public KeyPair(ECPrivateKey privateKey, ECPublicKey publicKey)
      Constructs a new KeyPair instance with the specified private and public keys.
      Parameters:
      privateKey - the elliptic curve private key associated with this key pair
      publicKey - the elliptic curve public key associated with this key pair
    • KeyPair

      public KeyPair(KeyPair keyPair)
      Constructs a new KeyPair instance using a KeyPair. The provided KeyPair must contain an Elliptic Curve private key and public key.
      Parameters:
      keyPair - the KeyPair containing the EC private and public keys
  • Method Details

    • getPrivateKey

      public ECPrivateKey getPrivateKey()
      Retrieves the elliptic curve private key associated with the key pair.
      Returns:
      the elliptic curve private key
    • getPublicKey

      public ECPublicKey getPublicKey()
      Retrieves the elliptic curve public key associated with the key pair.
      Returns:
      the elliptic curve public key