Class PublicKeyKeyEncryptionMethodGenerator
- java.lang.Object
-
- org.bouncycastle.openpgp.operator.PGPKeyEncryptionMethodGenerator
-
- org.bouncycastle.openpgp.operator.PublicKeyKeyEncryptionMethodGenerator
-
- Direct Known Subclasses:
BcPublicKeyKeyEncryptionMethodGenerator
,JcePublicKeyKeyEncryptionMethodGenerator
public abstract class PublicKeyKeyEncryptionMethodGenerator extends PGPKeyEncryptionMethodGenerator
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SESSION_KEY_OBFUSCATION_PROPERTY
protected boolean
sessionKeyObfuscation
protected boolean
useWildcardKeyID
static long
WILDCARD
-
Constructor Summary
Constructors Modifier Constructor Description protected
PublicKeyKeyEncryptionMethodGenerator(PGPPublicKey pubKey)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract byte[]
encryptSessionInfo(PGPPublicKey pubKey, byte[] sessionInfo)
ContainedPacket
generate(int encAlgorithm, byte[] sessionInfo)
ContainedPacket
generateV5(int encAlgorithm, int aeadAlgorithm, byte[] sessionInfo)
ContainedPacket
generateV6(int encAlgorithm, int aeadAlgorithm, byte[] sessionInfo)
byte[][]
processSessionInfo(byte[] encryptedSessionInfo)
PublicKeyKeyEncryptionMethodGenerator
setSessionKeyObfuscation(boolean enabled)
Controls whether to obfuscate the size of ECDH session keys using extra padding where necessary.PublicKeyKeyEncryptionMethodGenerator
setUseWildcardKeyID(boolean enabled)
Controls whether the recipient key ID is hidden (replaced by a wildcard ID
-
-
-
Field Detail
-
SESSION_KEY_OBFUSCATION_PROPERTY
public static final java.lang.String SESSION_KEY_OBFUSCATION_PROPERTY
- See Also:
- Constant Field Values
-
WILDCARD
public static final long WILDCARD
- See Also:
- Constant Field Values
-
sessionKeyObfuscation
protected boolean sessionKeyObfuscation
-
useWildcardKeyID
protected boolean useWildcardKeyID
-
-
Constructor Detail
-
PublicKeyKeyEncryptionMethodGenerator
protected PublicKeyKeyEncryptionMethodGenerator(PGPPublicKey pubKey)
-
-
Method Detail
-
setSessionKeyObfuscation
public PublicKeyKeyEncryptionMethodGenerator setSessionKeyObfuscation(boolean enabled)
Controls whether to obfuscate the size of ECDH session keys using extra padding where necessary.The default behaviour can be configured using the system property "", or else it will default to enabled.
- Returns:
- the current generator.
-
setUseWildcardKeyID
public PublicKeyKeyEncryptionMethodGenerator setUseWildcardKeyID(boolean enabled)
Controls whether the recipient key ID is hidden (replaced by a wildcard ID0
).- Parameters:
enabled
- boolean- Returns:
- this
-
processSessionInfo
public byte[][] processSessionInfo(byte[] encryptedSessionInfo) throws PGPException
- Throws:
PGPException
-
generate
public ContainedPacket generate(int encAlgorithm, byte[] sessionInfo) throws PGPException
- Specified by:
generate
in classPGPKeyEncryptionMethodGenerator
- Throws:
PGPException
-
generateV5
public ContainedPacket generateV5(int encAlgorithm, int aeadAlgorithm, byte[] sessionInfo) throws PGPException
- Specified by:
generateV5
in classPGPKeyEncryptionMethodGenerator
- Throws:
PGPException
-
generateV6
public ContainedPacket generateV6(int encAlgorithm, int aeadAlgorithm, byte[] sessionInfo) throws PGPException
- Specified by:
generateV6
in classPGPKeyEncryptionMethodGenerator
- Throws:
PGPException
-
encryptSessionInfo
protected abstract byte[] encryptSessionInfo(PGPPublicKey pubKey, byte[] sessionInfo) throws PGPException
- Throws:
PGPException
-
-