Class BcPublicKeyKeyEncryptionMethodGenerator
- java.lang.Object
-
- org.bouncycastle.openpgp.operator.PublicKeyKeyEncryptionMethodGenerator
-
- org.bouncycastle.openpgp.operator.bc.BcPublicKeyKeyEncryptionMethodGenerator
-
- All Implemented Interfaces:
PGPKeyEncryptionMethodGenerator
public class BcPublicKeyKeyEncryptionMethodGenerator extends PublicKeyKeyEncryptionMethodGenerator
A method generator for supporting public key based encryption operations.
-
-
Field Summary
-
Fields inherited from class org.bouncycastle.openpgp.operator.PublicKeyKeyEncryptionMethodGenerator
SESSION_KEY_OBFUSCATION_PROPERTY, sessionKeyObfuscation, useWildcardRecipient, WILDCARD, WILDCARD_FINGERPRINT, WILDCARD_KEYID
-
-
Constructor Summary
Constructors Constructor Description BcPublicKeyKeyEncryptionMethodGenerator(PGPPublicKey key)Create a public key encryption method generator with the method to be based on the passed in key.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]encryptSessionInfo(PGPPublicKey pubKey, byte[] sessionKey, byte symAlgId, boolean isV3)Encrypt a session key using the recipients public key.BcPublicKeyKeyEncryptionMethodGeneratorsetSecureRandom(java.security.SecureRandom random)Provide a user defined source of randomness.-
Methods inherited from class org.bouncycastle.openpgp.operator.PublicKeyKeyEncryptionMethodGenerator
createSessionInfo, encodeEncryptedSessionInfo, generate, getSessionInfo, setSessionKeyObfuscation, setUseWildcardKeyID, setUseWildcardRecipient
-
-
-
-
Constructor Detail
-
BcPublicKeyKeyEncryptionMethodGenerator
public BcPublicKeyKeyEncryptionMethodGenerator(PGPPublicKey key)
Create a public key encryption method generator with the method to be based on the passed in key.- Parameters:
key- the public key to use for encryption.
-
-
Method Detail
-
setSecureRandom
public BcPublicKeyKeyEncryptionMethodGenerator setSecureRandom(java.security.SecureRandom random)
Provide a user defined source of randomness.- Parameters:
random- the secure random to be used.- Returns:
- the current generator.
-
encryptSessionInfo
protected byte[] encryptSessionInfo(PGPPublicKey pubKey, byte[] sessionKey, byte symAlgId, boolean isV3) throws PGPException
Description copied from class:PublicKeyKeyEncryptionMethodGeneratorEncrypt a session key using the recipients public key.- Specified by:
encryptSessionInfoin classPublicKeyKeyEncryptionMethodGenerator- Parameters:
pubKey- recipients public keysessionKey- session-keysymAlgId- for v3: session key algorithm ID; for v6: 0- Returns:
- encrypted session info
- Throws:
PGPException
-
-