Top Description Fields Constructors Methods
org.bouncycastle.openpgp.operator

public abstract Class PBEDataDecryptorFactory

extends Object
implements PGPDataDecryptorFactory
Class Inheritance
All Implemented Interfaces
org.bouncycastle.openpgp.operator.PGPDataDecryptorFactory
Known Direct Subclasses
org.bouncycastle.openpgp.operator.bc.BcPBEDataDecryptorFactory
Imports
org.bouncycastle.bcpg.S2K, .SymmetricKeyAlgorithmTags, .SymmetricKeyEncSessionPacket, org.bouncycastle.openpgp.PGPException

A factory for performing PBE decryption operations. The purpose of this class is to act as an abstract factory, whose subclasses can decide, which concrete implementation to use for symmetric decryption of SKESK (symmetric-key-encrypted session-key) packets.

Field Summary

Modifier and TypeField and Description
private PGPDigestCalculatorProvider
private char[]

Constructor Summary

AccessConstructor and Description
protected
PBEDataDecryptorFactory(char[]
the pass phrase to generate decryption keys with.
passPhrase
,
PGPDigestCalculatorProvider
the digest to use in key generation.
calculatorProvider
)

Construct a PBE data decryptor factory.

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the key bytes for the encryption algorithm, generated using the pass phrase of this factory.
makeKeyFromPassPhrase
(int
the encryption algorithm to generate a key for.
keyAlgorithm
,
S2K
the string-to-key specification to use to generate the key.
s2k
)

Generates an encryption key using the pass phrase and digest calculator configured for this factory.

public abstract byte[]

Returns:

session key
recoverAEADEncryptedSessionData
(SymmetricKeyEncSessionPacket
v5 or v6 SKESK packet
keyData
,
byte[]
initial keying material (e.g. S2K result)
ikm
)

Recover the session data of a v5 SKESK or v6 SKESK packet.

public abstract byte[]

Returns:

the decrypted session data.
recoverSessionData
(int
the encryption algorithm used to encrypt the session data.
keyAlgorithm
,
byte[]
the key bytes for the encryption algorithm.
key
,
byte[]
the encrypted session data to decrypt.
seckKeyData
)

Decrypts session data from a v4 SKESK packet.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

calculatorProviderback to summary
private PGPDigestCalculatorProvider calculatorProvider
passPhraseback to summary
private char[] passPhrase

Constructor Detail

PBEDataDecryptorFactoryback to summary
protected PBEDataDecryptorFactory(char[] passPhrase, PGPDigestCalculatorProvider calculatorProvider)

Construct a PBE data decryptor factory.

Parameters
passPhrase:char[]

the pass phrase to generate decryption keys with.

calculatorProvider:PGPDigestCalculatorProvider

the digest to use in key generation.

Method Detail

makeKeyFromPassPhraseback to summary
public byte[] makeKeyFromPassPhrase(int keyAlgorithm, S2K s2k) throws PGPException

Generates an encryption key using the pass phrase and digest calculator configured for this factory.

Parameters
keyAlgorithm:int

the encryption algorithm to generate a key for.

s2k:S2K

the string-to-key specification to use to generate the key.

Returns:byte[]

the key bytes for the encryption algorithm, generated using the pass phrase of this factory.

Exceptions
PGPException:
if an error occurs generating the key.
recoverAEADEncryptedSessionDataback to summary
public abstract byte[] recoverAEADEncryptedSessionData(SymmetricKeyEncSessionPacket keyData, byte[] ikm) throws PGPException

Recover the session data of a v5 SKESK or v6 SKESK packet. These are used in OpenPGP v5 and v6.

Parameters
keyData:SymmetricKeyEncSessionPacket

v5 or v6 SKESK packet

ikm:byte[]

initial keying material (e.g. S2K result)

Returns:byte[]

session key

recoverSessionDataback to summary
public abstract byte[] recoverSessionData(int keyAlgorithm, byte[] key, byte[] seckKeyData) throws PGPException

Decrypts session data from a v4 SKESK packet. These are used in OpenPGP v4.

Parameters
keyAlgorithm:int

the encryption algorithm used to encrypt the session data.

key:byte[]

the key bytes for the encryption algorithm.

seckKeyData:byte[]

the encrypted session data to decrypt.

Returns:byte[]

the decrypted session data.

Exceptions
PGPException:
if an error occurs decrypting the session data.