Skip to content

Commit fa70560

Browse files
committed
Add isIntegrityProtected() to PGPEncryptedDataList
1 parent 0f549bb commit fa70560

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pg/src/main/java/org/bouncycastle/openpgp/PGPEncryptedDataList.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.bouncycastle.bcpg.Packet;
1515
import org.bouncycastle.bcpg.PacketTags;
1616
import org.bouncycastle.bcpg.PublicKeyEncSessionPacket;
17+
import org.bouncycastle.bcpg.SymmetricEncIntegrityPacket;
1718
import org.bouncycastle.bcpg.SymmetricKeyEncSessionPacket;
1819
import org.bouncycastle.bcpg.UnsupportedPacketVersionException;
1920
import org.bouncycastle.util.Iterable;
@@ -143,6 +144,15 @@ public PGPSessionKeyEncryptedData addSessionKeyDecryptionMethod(PGPSessionKey se
143144
return sessionKeyEncryptedData;
144145
}
145146

147+
/** Checks whether the packet is integrity protected.
148+
*
149+
* @return <code>true</code> if there is a modification detection code package associated with
150+
* this stream
151+
*/
152+
public boolean isIntegrityProtected() {
153+
return data instanceof SymmetricEncIntegrityPacket;
154+
}
155+
146156
/**
147157
* Gets the encryption method object at the specified index.
148158
*

0 commit comments

Comments
 (0)