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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract byte[]decryptECDH(ECDHPublicBCPGKey pubKey, PublicKey ephemeralKey) Perform an ECDH agreement to calculate a shared secret.abstract byte[]decryptElGamal(int keyAlgorithm, byte[][] secKeyData) Perform ElGamal decryption of an encrypted session key.abstract byte[]decryptRSA(int keyAlgorithm, byte[] pEnc) Perform RSA decryption of an encrypted session key.abstract byte[]decryptX25519(PublicKey ephemeralKey) Perform an X25519 agreement to calculate a shared secret.abstract byte[]decryptX448(PublicKey ephemeralKey) Perform an X448 agreement to calculate a shared secret.
-
Constructor Details
-
PublicKeyCryptoCallback
public PublicKeyCryptoCallback()
-
-
Method Details
-
decryptRSA
Perform RSA decryption of an encrypted session key.- Parameters:
keyAlgorithm- public key algorithmpEnc- encrypted session key- Returns:
- decrypted session key
- Throws:
PGPException- if the message cannot be decrypted
-
decryptElGamal
Perform ElGamal decryption of an encrypted session key.- Parameters:
keyAlgorithm- public key algorithmsecKeyData- encrypted session key data- Returns:
- decrypted session key
- Throws:
PGPException- if the message cannot be decrypted
-
decryptECDH
public abstract byte[] decryptECDH(ECDHPublicBCPGKey pubKey, PublicKey ephemeralKey) throws PGPException Perform an ECDH agreement to calculate a shared secret.- Parameters:
pubKey- our ECDH public keyephemeralKey- the sender's ephemeral public key- Returns:
- shared secret
- Throws:
PGPException- if the message cannot be decrypted
-
decryptX25519
Perform an X25519 agreement to calculate a shared secret.- Parameters:
ephemeralKey- the sender's ephemeral X25519 public key- Returns:
- shared secret
- Throws:
PGPException- if the message cannot be decrypted
-
decryptX448
Perform an X448 agreement to calculate a shared secret.- Parameters:
ephemeralKey- the sender's ephemeral X448 public key- Returns:
- shared secret
- Throws:
PGPException- if the message cannot be decrypted
-