Add isIntegrityProtected() to PGPEncryptedDataList
import org.bouncycastle.bcpg.Packet;
import org.bouncycastle.bcpg.PacketTags;
import org.bouncycastle.bcpg.PublicKeyEncSessionPacket;
+import org.bouncycastle.bcpg.SymmetricEncIntegrityPacket;
import org.bouncycastle.bcpg.SymmetricKeyEncSessionPacket;
import org.bouncycastle.bcpg.UnsupportedPacketVersionException;
import org.bouncycastle.util.Iterable;
@@ -143,6 +144,15 @@ public PGPSessionKeyEncryptedData addSessionKeyDecryptionMethod(PGPSessionKey se
return sessionKeyEncryptedData;
}
+ /** Checks whether the packet is integrity protected.
+ *
+ * @return <code>true</code> if there is a modification detection code package associated with
+ * this stream
+ */
+ public boolean isIntegrityProtected() {
+ return data instanceof SymmetricEncIntegrityPacket;
+ }
+
/**
* Gets the encryption method object at the specified index.
*
