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

public Class BcPBEDataDecryptorFactory

extends PBEDataDecryptorFactory
Class Inheritance
Imports
org.bouncycastle.bcpg.AEADEncDataPacket, .SymmetricEncIntegrityPacket, .SymmetricKeyAlgorithmTags, .SymmetricKeyEncSessionPacket, .SymmetricKeyUtils, .UnsupportedPacketVersionException, org.bouncycastle.crypto.BlockCipher, org.bouncycastle.openpgp.PGPException, .PGPSessionKey, org.bouncycastle.openpgp.operator.PBEDataDecryptorFactory, .PGPDataDecryptor, .PGPDigestCalculatorProvider, org.bouncycastle.util.Arrays

A PBEDataDecryptorFactory for handling PBE decryption operations using the Bouncy Castle lightweight API to implement cryptographic primitives.

Constructor Summary

AccessConstructor and Description
public
BcPBEDataDecryptorFactory(char[]
the passphrase to use as the primary source of key material.
pass
,
PGPDigestCalculatorProvider
a digest calculator provider to provide calculators to support the key generation calculation required.
calculatorProvider
)

Base constructor.

Method Summary

Modifier and TypeMethod and Description
public PGPDataDecryptor
createDataDecryptor(boolean
true if the packet to be decrypted has integrity checking enabled.
withIntegrityPacket
,
int
the identifier of the encryption algorithm to decrypt with.
encAlgorithm
,
byte[]
the bytes of the key for the cipher.
key
)

Implements org.bouncycastle.openpgp.operator.PGPDataDecryptorFactory.createDataDecryptor.

Constructs a data decryptor for SED or v1 SEIPD packets.

public PGPDataDecryptor
createDataDecryptor(AEADEncDataPacket
AEAD encrypted data packet
aeadEncDataPacket
,
PGPSessionKey
decrypted session key
sessionKey
)

Implements org.bouncycastle.openpgp.operator.PGPDataDecryptorFactory.createDataDecryptor.

Constructs a data decryptor for AEAD Encrypted Data packets.

public PGPDataDecryptor
createDataDecryptor(SymmetricEncIntegrityPacket
version 2 symmetrically encrypted integrity-protected data packet using AEAD.
seipd
,
PGPSessionKey
decrypted session key
sessionKey
)

Implements org.bouncycastle.openpgp.operator.PGPDataDecryptorFactory.createDataDecryptor.

Constructs a data decryptor for v2 SEIPD packets.

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

Implements abstract org.bouncycastle.openpgp.operator.PBEDataDecryptorFactory.recoverAEADEncryptedSessionData.

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

public byte[]

Returns:

session key
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.
secKeyData
)

Implements abstract org.bouncycastle.openpgp.operator.PBEDataDecryptorFactory.recoverSessionData.

Recover the session key from a version 4 SKESK packet used in OpenPGP v4.

Inherited from org.bouncycastle.openpgp.operator.PBEDataDecryptorFactory:
makeKeyFromPassPhrase

Constructor Detail

BcPBEDataDecryptorFactoryback to summary
public BcPBEDataDecryptorFactory(char[] pass, PGPDigestCalculatorProvider calculatorProvider)

Base constructor.

Parameters
pass:char[]

the passphrase to use as the primary source of key material.

calculatorProvider:PGPDigestCalculatorProvider

a digest calculator provider to provide calculators to support the key generation calculation required.

Method Detail

createDataDecryptorback to summary
public PGPDataDecryptor createDataDecryptor(boolean withIntegrityPacket, int encAlgorithm, byte[] key) throws PGPException

Implements org.bouncycastle.openpgp.operator.PGPDataDecryptorFactory.createDataDecryptor.

Doc from org.bouncycastle.openpgp.operator.PGPDataDecryptorFactory.createDataDecryptor.

Constructs a data decryptor for SED or v1 SEIPD packets.

Parameters
withIntegrityPacket:boolean

true if the packet to be decrypted has integrity checking enabled.

encAlgorithm:int

the identifier of the encryption algorithm to decrypt with.

key:byte[]

the bytes of the key for the cipher.

Returns:PGPDataDecryptor

a data decryptor that can decrypt (and verify) streams of encrypted data.

Annotations
@Override
Exceptions
PGPException:
if an error occurs initialising the decryption and integrity checking functions.
createDataDecryptorback to summary
public PGPDataDecryptor createDataDecryptor(AEADEncDataPacket aeadEncDataPacket, PGPSessionKey sessionKey) throws PGPException

Implements org.bouncycastle.openpgp.operator.PGPDataDecryptorFactory.createDataDecryptor.

Doc from org.bouncycastle.openpgp.operator.PGPDataDecryptorFactory.createDataDecryptor.

Constructs a data decryptor for AEAD Encrypted Data packets. This method is used with OpenPGP v5 AEAD.

Parameters
aeadEncDataPacket:AEADEncDataPacket

AEAD encrypted data packet

sessionKey:PGPSessionKey

decrypted session key

Returns:PGPDataDecryptor

a data decryptor that can decrypt (and verify) streams of encrypted data.

Annotations
@Override
Exceptions
PGPException:
if an error occurs initialising the decryption and integrity checking functions.
createDataDecryptorback to summary
public PGPDataDecryptor createDataDecryptor(SymmetricEncIntegrityPacket seipd, PGPSessionKey sessionKey) throws PGPException

Implements org.bouncycastle.openpgp.operator.PGPDataDecryptorFactory.createDataDecryptor.

Doc from org.bouncycastle.openpgp.operator.PGPDataDecryptorFactory.createDataDecryptor.

Constructs a data decryptor for v2 SEIPD packets. This method is used with OpenPGP v6 AEAD.

Parameters
seipd:SymmetricEncIntegrityPacket

version 2 symmetrically encrypted integrity-protected data packet using AEAD.

sessionKey:PGPSessionKey

decrypted session key

Returns:PGPDataDecryptor

a data decryptor that can decrypt (and verify) streams of encrypted data.

Annotations
@Override
Exceptions
PGPException:
if an error occurs initialising the decryption and integrity checking functions.
recoverAEADEncryptedSessionDataback to summary
public byte[] recoverAEADEncryptedSessionData(SymmetricKeyEncSessionPacket keyData, byte[] ikm) throws PGPException

Implements abstract org.bouncycastle.openpgp.operator.PBEDataDecryptorFactory.recoverAEADEncryptedSessionData.

Doc from org.bouncycastle.openpgp.operator.PBEDataDecryptorFactory.recoverAEADEncryptedSessionData.

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

Annotations
@Override
recoverSessionDataback to summary
public byte[] recoverSessionData(int keyAlgorithm, byte[] key, byte[] secKeyData) throws PGPException

Implements abstract org.bouncycastle.openpgp.operator.PBEDataDecryptorFactory.recoverSessionData.

Recover the session key from a version 4 SKESK packet 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.

secKeyData:byte[]

the encrypted session data to decrypt.

Returns:byte[]

session key

Annotations
@Override
Exceptions
PGPException:

Doc from org.bouncycastle.openpgp.operator.PBEDataDecryptorFactory.recoverSessionData.

if an error occurs decrypting the session data.