Class AsymmetricKeyPair<P extends AsymmetricPublicKey,S extends AsymmetricPrivateKey>

java.lang.Object
org.bouncycastle.crypto.asymmetric.AsymmetricKeyPair<P,S>

public final class AsymmetricKeyPair<P extends AsymmetricPublicKey,S extends AsymmetricPrivateKey> extends Object
Carrier class for a public key and its associated private key. This class will check the key pair on construction.
  • Constructor Details

    • AsymmetricKeyPair

      public AsymmetricKeyPair(P publicKey, S privateKey)
      Create a public/private key pair.
      Parameters:
      publicKey - the public key component.
      privateKey - the private key component.
      Throws:
      IllegalArgumentException - if the public and private key arguments are inconsistent.
  • Method Details

    • getPublicKey

      public P getPublicKey()
      Return the public key of the pair.
      Returns:
      the public key.
    • getPrivateKey

      public S getPrivateKey()
      Return the private key of the pair.
      Returns:
      the private key.