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.StringSESSION_KEY_OBFUSCATION_PROPERTYprotected booleansessionKeyObfuscation
-
Constructor Summary
Constructors Modifier Constructor Description protectedPublicKeyKeyEncryptionMethodGenerator(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)ContainedPacketgenerate(int encAlgorithm, byte[] sessionInfo)Generates a packet encoding the details of this encryption method.byte[][]processSessionInfo(byte[] encryptedSessionInfo)PublicKeyKeyEncryptionMethodGeneratorsetSessionKeyObfuscation(boolean enabled)Controls whether to obfuscate the size of ECDH session keys using extra padding where necessary.
-
-
-
Field Detail
-
SESSION_KEY_OBFUSCATION_PROPERTY
public static final java.lang.String SESSION_KEY_OBFUSCATION_PROPERTY
- See Also:
- Constant Field Values
-
sessionKeyObfuscation
protected boolean sessionKeyObfuscation
-
-
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.
-
processSessionInfo
public byte[][] processSessionInfo(byte[] encryptedSessionInfo) throws PGPException- Throws:
PGPException
-
generate
public ContainedPacket generate(int encAlgorithm, byte[] sessionInfo) throws PGPException
Description copied from class:PGPKeyEncryptionMethodGeneratorGenerates a packet encoding the details of this encryption method.- Specified by:
generatein classPGPKeyEncryptionMethodGenerator- Parameters:
encAlgorithm- theencryption algorithmbeing usedsessionInfo- session data generated by the encrypted data generator.- Returns:
- a packet encoding the provided information and the configuration of this instance.
- Throws:
PGPException- if an error occurs constructing the packet.
-
encryptSessionInfo
protected abstract byte[] encryptSessionInfo(PGPPublicKey pubKey, byte[] sessionInfo) throws PGPException
- Throws:
PGPException
-
-