Skip to content

Commit 13847c1

Browse files
committed
Add LibrePGPPreferredEncryptionModes signature subpacket
1 parent 92e1624 commit 13847c1

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

pg/src/main/java/org/bouncycastle/bcpg/SignatureSubpacketInputStream.java

+1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ else if (l == 255)
165165
case PREFERRED_COMP_ALGS:
166166
case PREFERRED_HASH_ALGS:
167167
case PREFERRED_SYM_ALGS:
168+
case LIBREPGP_PREFERRED_ENCRYPTION_MODES:
168169
return new PreferredAlgorithms(type, isCritical, isLongLength, data);
169170
case PREFERRED_AEAD_ALGORITHMS:
170171
return new PreferredAEADCiphersuites(isCritical, isLongLength, data);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.bouncycastle.bcpg.sig;
2+
3+
import org.bouncycastle.bcpg.SignatureSubpacketTags;
4+
5+
/**
6+
* This is a deprecated LibrePGP signature subpacket with encryption mode numbers to indicate which modes
7+
* the key holder prefers to use with OCB Encrypted Data Packets ({@link org.bouncycastle.bcpg.AEADEncDataPacket}).
8+
* Implementations SHOULD ignore this subpacket and assume {@link org.bouncycastle.bcpg.AEADAlgorithmTags#OCB}.
9+
*/
10+
public class LibrePGPPreferredEncryptionModes
11+
extends PreferredAlgorithms
12+
{
13+
14+
public LibrePGPPreferredEncryptionModes(boolean isCritical, int[] encryptionModes)
15+
{
16+
this(isCritical, false, intToByteArray(encryptionModes));
17+
}
18+
19+
protected LibrePGPPreferredEncryptionModes(boolean critical, boolean isLongLength, byte[] data)
20+
{
21+
super(SignatureSubpacketTags.LIBREPGP_PREFERRED_ENCRYPTION_MODES, critical, isLongLength, data);
22+
}
23+
}

0 commit comments

Comments
 (0)