Skip to content

Commit

Permalink
Add LibrePGPPreferredEncryptionModes signature subpacket
Browse files Browse the repository at this point in the history
  • Loading branch information
vanitasvitae committed Jul 17, 2024
1 parent 92e1624 commit 13847c1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ else if (l == 255)
case PREFERRED_COMP_ALGS:
case PREFERRED_HASH_ALGS:
case PREFERRED_SYM_ALGS:
case LIBREPGP_PREFERRED_ENCRYPTION_MODES:
return new PreferredAlgorithms(type, isCritical, isLongLength, data);
case PREFERRED_AEAD_ALGORITHMS:
return new PreferredAEADCiphersuites(isCritical, isLongLength, data);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.bouncycastle.bcpg.sig;

import org.bouncycastle.bcpg.SignatureSubpacketTags;

/**
* This is a deprecated LibrePGP signature subpacket with encryption mode numbers to indicate which modes
* the key holder prefers to use with OCB Encrypted Data Packets ({@link org.bouncycastle.bcpg.AEADEncDataPacket}).
* Implementations SHOULD ignore this subpacket and assume {@link org.bouncycastle.bcpg.AEADAlgorithmTags#OCB}.
*/
public class LibrePGPPreferredEncryptionModes
extends PreferredAlgorithms
{

public LibrePGPPreferredEncryptionModes(boolean isCritical, int[] encryptionModes)
{
this(isCritical, false, intToByteArray(encryptionModes));
}

protected LibrePGPPreferredEncryptionModes(boolean critical, boolean isLongLength, byte[] data)
{
super(SignatureSubpacketTags.LIBREPGP_PREFERRED_ENCRYPTION_MODES, critical, isLongLength, data);
}
}

0 comments on commit 13847c1

Please sign in to comment.