Top Description Fields Constructors Methods
org.bouncycastle.openpgp

public Class PGPPublicKeyEncryptedData

extends PGPEncryptedData
Class Inheritance
Imports
java.io.EOFException, .InputStream, org.bouncycastle.bcpg.AEADEncDataPacket, .BCPGInputStream, .InputStreamPacket, .PublicKeyEncSessionPacket, .SymmetricEncIntegrityPacket, .SymmetricKeyAlgorithmTags, org.bouncycastle.openpgp.operator.PGPDataDecryptor, .PGPDataDecryptorFactory, .PublicKeyDataDecryptorFactory, .SessionKeyDataDecryptorFactory, org.bouncycastle.util.Arrays, org.bouncycastle.util.io.TeeInputStream

A public key encrypted data object.

Field Summary

Modifier and TypeField and Description
pack-priv PublicKeyEncSessionPacket
Inherited from org.bouncycastle.openpgp.PGPEncryptedData:
encDataencStreamintegrityCalculatortruncStream

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private boolean
confirmCheckSum(byte[] sessionInfo)

public int
getAlgorithm()

Overrides org.bouncycastle.openpgp.PGPEncryptedData.getAlgorithm.

Return the symmetric encryption algorithm that is used by the packet.
public InputStream

Returns:

the resulting input stream
getDataStream
(PublicKeyDataDecryptorFactory
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.
private InputStream

Returns:

the resulting input stream
getDataStream
(PGPDataDecryptorFactory
decryptor factory to use to recover the session data and provide the stream.
dataDecryptorFactory
,
PGPSessionKey
the session key for the stream.
sessionKey
)

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

public long

Returns:

long
getKeyID
()

Return the keyID for the key used to encrypt the data.

public PGPSessionKey

Returns:

session key used to decrypt the data protected by this object
getSessionKey
(PublicKeyDataDecryptorFactory
decryptor factory to use to recover the session data.
dataDecryptorFactory
)

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

public int

Returns:

the identifier of the encryption algorithm used to encrypt this object.
getSymmetricAlgorithm
(PublicKeyDataDecryptorFactory
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.PGPEncryptedData:
getInputStreamisIntegrityProtectedverify

Field Detail

keyDataback to summary
pack-priv PublicKeyEncSessionPacket keyData

Constructor Detail

PGPPublicKeyEncryptedDataback to summary
pack-priv PGPPublicKeyEncryptedData(PublicKeyEncSessionPacket keyData, InputStreamPacket encData)

Method Detail

confirmCheckSumback to summary
private boolean confirmCheckSum(byte[] sessionInfo)
getAlgorithmback to summary
public int getAlgorithm()

Overrides org.bouncycastle.openpgp.PGPEncryptedData.getAlgorithm.

Doc from org.bouncycastle.openpgp.PGPEncryptedData.getAlgorithm.

Return the symmetric encryption algorithm that is used by the packet.

Returns:int

algorithm

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

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

Parameters
dataDecryptorFactory:PublicKeyDataDecryptorFactory

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

Returns:InputStream

the resulting input stream

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.

getDataStreamback to summary
private InputStream getDataStream(PGPDataDecryptorFactory dataDecryptorFactory, PGPSessionKey sessionKey) throws PGPException

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

Parameters
dataDecryptorFactory:PGPDataDecryptorFactory

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

sessionKey:PGPSessionKey

the session key for the stream.

Returns:InputStream

the resulting input stream

Exceptions
PGPException:
if the session data cannot be recovered or the stream cannot be created.
getKeyIDback to summary
public long getKeyID()

Return the keyID for the key used to encrypt the data.

Returns:long

long

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

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

Parameters
dataDecryptorFactory:PublicKeyDataDecryptorFactory

decryptor factory to use to recover the session data.

Returns:PGPSessionKey

session key used to decrypt the data protected by this object

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

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

Parameters
dataDecryptorFactory:PublicKeyDataDecryptorFactory

decryptor factory to use to recover the session data.

Returns:int

the identifier of the encryption algorithm used to encrypt this object.

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