Top Description Fields Constructors Methods
org.bouncycastle.openpgp

public Class PGPPBEEncryptedData

extends PGPSymmetricKeyEncryptedData
Class Inheritance
Imports
java.io.InputStream, org.bouncycastle.bcpg.InputStreamPacket, .SymmetricEncDataPacket, .SymmetricEncIntegrityPacket, .SymmetricKeyAlgorithmTags, .SymmetricKeyEncSessionPacket, .UnsupportedPacketVersionException, org.bouncycastle.openpgp.operator.PBEDataDecryptorFactory, .SessionKeyDataDecryptorFactory, org.bouncycastle.util.Arrays

A password based encryption object.

PBE encrypted data objects can be decrypted using a PBEDataDecryptorFactory.

Field Summary

Modifier and TypeField and Description
pack-priv SymmetricKeyEncSessionPacket

Constructor Summary

AccessConstructor and Description
pack-priv
PGPPBEEncryptedData(SymmetricKeyEncSessionPacket
the PBE key data packet associated with the encrypted data in the PGP object stream.
keyData
,
InputStreamPacket
the encrypted data.
encData
)

Construct a PBE encrypted data object.

Method Summary

Modifier and TypeMethod and Description
private static void
public int

Returns:

password-based encryption algorithm identifier (SymmetricKeyAlgorithmTags)
getAlgorithm
()

Overrides org.bouncycastle.openpgp.PGPEncryptedData.getAlgorithm.

Symmetric-key algorithm used by this object to protect the session key (getSymmetricAlgorithm(PBEDataDecryptorFactory) with.

public InputStream

Returns:

the resulting decrypted input stream, probably containing a sequence of PGP data objects.
getDataStream
(PBEDataDecryptorFactory
decryptor factory to use to recover the session data and provide the stream.
dataDecryptorFactory
)

Open an input stream which will provide the decrypted data protected by this object.

public InputStream
getDataStream(SessionKeyDataDecryptorFactory dataDecryptorFactory)
Deprecated will be removed in 1.74, use PGPEncryptedDataList.extractSessionKeyEncryptedData() and then apply the dataDecryptorFactory.

public PGPSessionKey

Returns:

session key
getSessionKey
(PBEDataDecryptorFactory
decryptor factory used to recover the session data.
dataDecryptorFactory
)

Return the symmetric session key required to decrypt the data protected by this object.

public int

Returns:

session key algorithm identifier (SymmetricKeyAlgorithmTags)
getSymmetricAlgorithm
(PBEDataDecryptorFactory
decryptor factory to use to recover the session data.
dataDecryptorFactory
)

Return the symmetric key algorithm required to decrypt the data protected by this object.

public int
getVersion()

Overrides org.bouncycastle.openpgp.PGPEncryptedData.getVersion.

Return the version number of the Encrypted Session Key Packet.

Inherited from org.bouncycastle.openpgp.PGPSymmetricKeyEncryptedData:
createDecryptionStream

Field Detail

keyDataback to summary
pack-priv SymmetricKeyEncSessionPacket keyData

Constructor Detail

PGPPBEEncryptedDataback to summary
pack-priv PGPPBEEncryptedData(SymmetricKeyEncSessionPacket keyData, InputStreamPacket encData)

Construct a PBE encrypted data object.

Parameters
keyData:SymmetricKeyEncSessionPacket

the PBE key data packet associated with the encrypted data in the PGP object stream.

encData:InputStreamPacket

the encrypted data.

Method Detail

enforceConstraintsback to summary
private static void enforceConstraints(SymmetricKeyEncSessionPacket keyData, InputStreamPacket encData)
getAlgorithmback to summary
public int getAlgorithm()

Overrides org.bouncycastle.openpgp.PGPEncryptedData.getAlgorithm.

Symmetric-key algorithm used by this object to protect the session key (getSymmetricAlgorithm(PBEDataDecryptorFactory) with.

Returns:int

password-based encryption algorithm identifier (SymmetricKeyAlgorithmTags)

getDataStreamback to summary
public InputStream getDataStream(PBEDataDecryptorFactory dataDecryptorFactory) throws PGPException

Open an input stream which will provide the decrypted data protected by this object.

Parameters
dataDecryptorFactory:PBEDataDecryptorFactory

decryptor factory to use to recover the session data and provide the stream.

Returns:InputStream

the resulting decrypted input stream, probably containing a sequence of PGP data objects.

Exceptions
PGPException:
if the session data cannot be recovered or the stream cannot be created.
getDataStreamback to summary
public InputStream getDataStream(SessionKeyDataDecryptorFactory dataDecryptorFactory) throws PGPException

Deprecated

will be removed in 1.74, use PGPEncryptedDataList.extractSessionKeyEncryptedData() and then apply the dataDecryptorFactory.

getSessionKeyback to summary
public PGPSessionKey getSessionKey(PBEDataDecryptorFactory dataDecryptorFactory) throws PGPException

Return the symmetric session key required to decrypt the data protected by this object.

Parameters
dataDecryptorFactory:PBEDataDecryptorFactory

decryptor factory used to recover the session data.

Returns:PGPSessionKey

session key

Exceptions
PGPException:
if the session data cannot be recovered
getSymmetricAlgorithmback to summary
public int getSymmetricAlgorithm(PBEDataDecryptorFactory dataDecryptorFactory) throws PGPException

Return the symmetric key algorithm required to decrypt the data protected by this object.

Parameters
dataDecryptorFactory:PBEDataDecryptorFactory

decryptor factory to use to recover the session data.

Returns:int

session key algorithm identifier (SymmetricKeyAlgorithmTags)

Exceptions
PGPException:
if the session data cannot be recovered.
getVersionback to summary
public int getVersion()

Overrides org.bouncycastle.openpgp.PGPEncryptedData.getVersion.

Doc from org.bouncycastle.openpgp.PGPEncryptedData.getVersion.

Return the version number of the Encrypted Session Key Packet.

Returns:int

version