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
Imports
org.bouncycastle.bcpg.S2K, .SymmetricKeyAlgorithmTags, org.bouncycastle.openpgp.PGPException

A factory for performing PBE decryption operations.

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:

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 an encrypted data 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.
recoverSessionDataback to summary
public abstract byte[] recoverSessionData(int keyAlgorithm, byte[] key, byte[] seckKeyData) throws PGPException

Decrypts session data from an encrypted data packet.

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.