Class PGPPBEEncryptedData
java.lang.Object
org.bouncycastle.openpgp.PGPEncryptedData
org.bouncycastle.openpgp.PGPSymmetricKeyEncryptedData
org.bouncycastle.openpgp.PGPPBEEncryptedData
- All Implemented Interfaces:
AEADAlgorithmTags, SymmetricKeyAlgorithmTags
A password based encryption object.
PBE encrypted data objects can be decrypted
using a PBEDataDecryptorFactory.
-
Nested Class Summary
Nested classes/interfaces inherited from class PGPEncryptedData
PGPEncryptedData.TruncatedStream -
Field Summary
Fields inherited from interface AEADAlgorithmTags
EAX, GCM, OCBFields inherited from interface 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 TypeMethodDescriptionintSymmetric-key algorithm used by this object to protect the session key (getSymmetricAlgorithm(PBEDataDecryptorFactory)with.getDataStream(PBEDataDecryptorFactory 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.getSessionKey(PBEDataDecryptorFactory dataDecryptorFactory) Return the symmetric session key required to decrypt the data protected by this object.intgetSymmetricAlgorithm(PBEDataDecryptorFactory dataDecryptorFactory) Return the symmetric key algorithm required to decrypt the data protected by this object.intReturn the version number of the Encrypted Session Key Packet.Methods inherited from class PGPSymmetricKeyEncryptedData
createDecryptionStreamMethods inherited from class PGPEncryptedData
getEncData, getInputStream, isAEAD, isIntegrityProtected, verify
-
Method Details
-
getVersion
public int getVersion()Description copied from class:PGPEncryptedDataReturn the version number of the Encrypted Session Key Packet.- Overrides:
getVersionin classPGPEncryptedData- Returns:
- version
-
getAlgorithm
public int getAlgorithm()Symmetric-key algorithm used by this object to protect the session key (getSymmetricAlgorithm(PBEDataDecryptorFactory)with.- Overrides:
getAlgorithmin classPGPEncryptedData- Returns:
- password-based encryption algorithm identifier (
SymmetricKeyAlgorithmTags)
-
getSymmetricAlgorithm
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:
- session key algorithm identifier (
SymmetricKeyAlgorithmTags) - Throws:
PGPException- if the session data cannot be recovered.
-
getSessionKey
public PGPSessionKey getSessionKey(PBEDataDecryptorFactory dataDecryptorFactory) throws PGPException Return the symmetric session key required to decrypt the data protected by this object.- Parameters:
dataDecryptorFactory- decryptor factory used to recover the session data.- Returns:
- session key
- Throws:
PGPException- if the session data cannot be recovered
-
getDataStream
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 decrypted input stream, probably containing a sequence of PGP data objects.
- 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
-