Package org.bouncycastle.openpgp
Class PGPEncryptedData
java.lang.Object
org.bouncycastle.openpgp.PGPEncryptedData
- All Implemented Interfaces:
SymmetricKeyAlgorithmTags
- Direct Known Subclasses:
PGPPBEEncryptedData,PGPPublicKeyEncryptedData
A PGP encrypted data object.
Encrypted data packets are decrypted using a PGPDataDecryptor obtained from a
PGPDataDecryptorFactory.
-
Nested Class Summary
Nested Classes -
Field Summary
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 TypeMethodDescriptionReturn the raw input stream for the data stream.booleanChecks whether the packet is integrity protected.booleanverify()Verifies the integrity of the packet against the modification detection code associated with it in the stream.
-
Method Details
-
getInputStream
Return the raw input stream for the data stream.Note this stream is shared with all other encryption methods in the same
PGPEncryptedDataListand with any decryption methods in sub-classes, so consuming this stream will affect decryption.- Returns:
- the encrypted data in this packet.
-
isIntegrityProtected
public boolean isIntegrityProtected()Checks whether the packet is integrity protected.- Returns:
trueif there is a modification detection code package associated with this stream
-
verify
Verifies the integrity of the packet against the modification detection code associated with it in the stream.Note: This can only be called after the message has been read.
- Returns:
trueif the message verifies,falseotherwise.- Throws:
PGPException- if the message is notintegrity protected.IOException
-