Top Fields Constructors Methods
org.bouncycastle.openpgp.operator

public abstract Class PublicKeyKeyEncryptionMethodGenerator

extends PGPKeyEncryptionMethodGenerator
Class Inheritance
Known Direct Subclasses
org.bouncycastle.openpgp.operator.jcajce.JcePublicKeyKeyEncryptionMethodGenerator
Imports
java.io.IOException, java.math.BigInteger, org.bouncycastle.bcpg.ContainedPacket, .MPInteger, .PublicKeyEncSessionPacket, org.bouncycastle.openpgp.PGPException, .PGPPublicKey

Field Summary

Modifier and TypeField and Description
private PGPPublicKey
public static final String
protected boolean

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
private byte[]
convertToEncodedMPI(byte[] encryptedSessionInfo)

protected abstract byte[]
encryptSessionInfo(PGPPublicKey pubKey, byte[] sessionInfo)

public ContainedPacket
generate(int
the encryption algorithm being used
encAlgorithm
,
byte[]
session data generated by the encrypted data generator.
sessionInfo
)

Implements abstract org.bouncycastle.openpgp.operator.PGPKeyEncryptionMethodGenerator.generate.

Generates a packet encoding the details of this encryption method.
private static boolean
public byte[][]
processSessionInfo(byte[] encryptedSessionInfo)

public PublicKeyKeyEncryptionMethodGenerator

Returns:

the current generator.
setSessionKeyObfuscation
(boolean enabled)

Controls whether to obfuscate the size of ECDH session keys using extra padding where necessary.

Field Detail

pubKeyback to summary
private PGPPublicKey pubKey
SESSION_KEY_OBFUSCATION_PROPERTYback to summary
public static final String SESSION_KEY_OBFUSCATION_PROPERTY
sessionKeyObfuscationback to summary
protected boolean sessionKeyObfuscation

Constructor Detail

PublicKeyKeyEncryptionMethodGeneratorback to summary
protected PublicKeyKeyEncryptionMethodGenerator(PGPPublicKey pubKey)

Method Detail

convertToEncodedMPIback to summary
private byte[] convertToEncodedMPI(byte[] encryptedSessionInfo) throws PGPException
encryptSessionInfoback to summary
protected abstract byte[] encryptSessionInfo(PGPPublicKey pubKey, byte[] sessionInfo) throws PGPException
generateback to summary
public ContainedPacket generate(int encAlgorithm, byte[] sessionInfo) throws PGPException

Implements abstract org.bouncycastle.openpgp.operator.PGPKeyEncryptionMethodGenerator.generate.

Doc from org.bouncycastle.openpgp.operator.PGPKeyEncryptionMethodGenerator.generate.

Generates a packet encoding the details of this encryption method.

Parameters
encAlgorithm:int

the encryption algorithm being used

sessionInfo:byte[]

session data generated by the encrypted data generator.

Returns:ContainedPacket

a packet encoding the provided information and the configuration of this instance.

Exceptions
PGPException:
if an error occurs constructing the packet.
getSessionKeyObfuscationDefaultback to summary
private static boolean getSessionKeyObfuscationDefault()
processSessionInfoback to summary
public byte[][] processSessionInfo(byte[] encryptedSessionInfo) throws PGPException
setSessionKeyObfuscationback to summary
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:PublicKeyKeyEncryptionMethodGenerator

the current generator.