Package org.bouncycastle.openpgp
Class PGPPublicKeyEncryptedData
java.lang.Object
org.bouncycastle.openpgp.PGPEncryptedData
org.bouncycastle.openpgp.PGPPublicKeyEncryptedData
- All Implemented Interfaces:
AEADAlgorithmTags
,SymmetricKeyAlgorithmTags
A public key encrypted data object.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bouncycastle.openpgp.PGPEncryptedData
PGPEncryptedData.TruncatedStream
-
Field Summary
Fields inherited from interface org.bouncycastle.bcpg.AEADAlgorithmTags
EAX, GCM, OCB
Fields inherited from interface org.bouncycastle.bcpg.SymmetricKeyAlgorithmTags
AES_128, AES_192, AES_256, BLOWFISH, CAMELLIA_128, CAMELLIA_192, CAMELLIA_256, CAST5, DES, IDEA, NULL, SAFER, TRIPLE_DES, TWOFISH
-
Method Summary
Modifier and TypeMethodDescriptionint
Return the symmetric encryption algorithm that is used by the packet.getDataStream
(PublicKeyDataDecryptorFactory dataDecryptorFactory) Open an input stream which will provide the decrypted data protected by this object.getDataStream
(SessionKeyDataDecryptorFactory dataDecryptorFactory) Deprecated.will be removed in 1.74, use PGPEncryptedDataList.extractSessionKeyEncryptedData() and then apply the dataDecryptorFactory.long
getKeyID()
Deprecated.usegetKeyIdentifier()
insteadReturn aKeyIdentifier
for the key used to encrypt the data.getSessionKey
(PublicKeyDataDecryptorFactory dataDecryptorFactory) Return the symmetric session key required to decrypt the data protected by this object.int
getSymmetricAlgorithm
(PublicKeyDataDecryptorFactory dataDecryptorFactory) Return the symmetric key algorithm required to decrypt the data protected by this object.int
Return the version number of the Encrypted Session Key Packet.Methods inherited from class org.bouncycastle.openpgp.PGPEncryptedData
getInputStream, isAEAD, isIntegrityProtected, verify
-
Method Details
-
getKeyID
Deprecated.usegetKeyIdentifier()
insteadReturn the keyID for the key used to encrypt the data.- Returns:
- long
-
getKeyIdentifier
Return aKeyIdentifier
for the key used to encrypt the data.- Returns:
- key identifier
-
getSymmetricAlgorithm
public int getSymmetricAlgorithm(PublicKeyDataDecryptorFactory dataDecryptorFactory) throws PGPException Return the symmetric key algorithm required to decrypt the data protected by this object.- Parameters:
dataDecryptorFactory
- decryptor factory to use to recover the session data.- Returns:
- the identifier of the
encryption algorithm
used to encrypt this object. - Throws:
PGPException
- if the session data cannot be recovered.
-
getSessionKey
public PGPSessionKey getSessionKey(PublicKeyDataDecryptorFactory dataDecryptorFactory) throws PGPException Return the symmetric session key required to decrypt the data protected by this object.- Parameters:
dataDecryptorFactory
- decryptor factory to use to recover the session data.- Returns:
- session key used to decrypt the data protected by this object
- Throws:
PGPException
- if the session data cannot be recovered.
-
getDataStream
public InputStream getDataStream(PublicKeyDataDecryptorFactory dataDecryptorFactory) throws PGPException Open an input stream which will provide the decrypted data protected by this object.- Parameters:
dataDecryptorFactory
- decryptor factory to use to recover the session data and provide the stream.- Returns:
- the resulting input stream
- Throws:
PGPException
- if the session data cannot be recovered or the stream cannot be created.
-
getDataStream
public InputStream getDataStream(SessionKeyDataDecryptorFactory dataDecryptorFactory) throws PGPException Deprecated.will be removed in 1.74, use PGPEncryptedDataList.extractSessionKeyEncryptedData() and then apply the dataDecryptorFactory.- Throws:
PGPException
-
getAlgorithm
public int getAlgorithm()Description copied from class:PGPEncryptedData
Return the symmetric encryption algorithm that is used by the packet.- Overrides:
getAlgorithm
in classPGPEncryptedData
- Returns:
- algorithm
-
getVersion
public int getVersion()Description copied from class:PGPEncryptedData
Return the version number of the Encrypted Session Key Packet.- Overrides:
getVersion
in classPGPEncryptedData
- Returns:
- version
-