Class JceExternalPublicKeyDataDecryptorFactoryBuilder.PublicKeyCryptoCallback

java.lang.Object
org.bouncycastle.openpgp.api.operator.jcajce.JceExternalPublicKeyDataDecryptorFactoryBuilder.PublicKeyCryptoCallback
Enclosing class:
JceExternalPublicKeyDataDecryptorFactoryBuilder

public abstract static class JceExternalPublicKeyDataDecryptorFactoryBuilder.PublicKeyCryptoCallback extends Object
Callback isolating the raw public-key operations performed while recovering an OpenPGP session key. This is the JCA binding of the hooks AbstractExternalPublicKeyDataDecryptorFactory drives: ephemeral keys arrive as JCA PublicKey objects built through the configured provider, and no software private key is passed (the key material is held externally). See that class for the split between what the callback does and what the factory does.
  • Constructor Details

    • PublicKeyCryptoCallback

      public PublicKeyCryptoCallback()
  • Method Details

    • decrypt

      public abstract byte[] decrypt(int keyAlgorithm, byte[][] pEnc) throws PGPException
      Perform RSA/ElGamal decryption of an encrypted session key.
      Parameters:
      keyAlgorithm - public key algorithm
      pEnc - encrypted session key
      Returns:
      decrypted session key
      Throws:
      PGPException - if the message cannot be decrypted
    • decrypt

      public abstract byte[] decrypt(int keyAlgorithm, PublicKey ephemeralKey) throws PGPException
      Perform an ECDH / X25519 / X448 agreement to calculate a shared secret.
      Parameters:
      ephemeralKey - the message's ephemeral public key
      Returns:
      shared secret
      Throws:
      PGPException - if the message cannot be decrypted