public class BcPublicKeyKeyEncryptionMethodGenerator extends PublicKeyKeyEncryptionMethodGenerator
SESSION_KEY_OBFUSCATION_PROPERTY, sessionKeyObfuscation, useWildcardRecipient, WILDCARD, WILDCARD_FINGERPRINT, WILDCARD_KEYID
Constructor and Description |
---|
BcPublicKeyKeyEncryptionMethodGenerator(PGPPublicKey key)
Create a public key encryption method generator with the method to be based on the passed in key.
|
Modifier and Type | Method and Description |
---|---|
protected byte[] |
encryptSessionInfo(PGPPublicKey pubKey,
byte[] sessionKey,
byte symAlgId,
boolean isV3)
Encrypt a session key using the recipients public key.
|
BcPublicKeyKeyEncryptionMethodGenerator |
setSecureRandom(java.security.SecureRandom random)
Provide a user defined source of randomness.
|
createSessionInfo, encodeEncryptedSessionInfo, generate, getSessionInfo, setSessionKeyObfuscation, setUseWildcardKeyID, setUseWildcardRecipient
public BcPublicKeyKeyEncryptionMethodGenerator(PGPPublicKey key)
key
- the public key to use for encryption.public BcPublicKeyKeyEncryptionMethodGenerator setSecureRandom(java.security.SecureRandom random)
random
- the secure random to be used.protected byte[] encryptSessionInfo(PGPPublicKey pubKey, byte[] sessionKey, byte symAlgId, boolean isV3) throws PGPException
PublicKeyKeyEncryptionMethodGenerator
encryptSessionInfo
in class PublicKeyKeyEncryptionMethodGenerator
pubKey
- recipients public keysessionKey
- session-keysymAlgId
- for v3: session key algorithm ID; for v6: 0PGPException