mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-22 10:57:58 +01:00
Rename GNUPG features
This commit is contained in:
parent
ec6fc810d4
commit
55058d6070
3 changed files with 7 additions and 7 deletions
|
@ -41,7 +41,7 @@ public enum Feature {
|
|||
* @see <a href="https://openpgp-wg.gitlab.io/rfc4880bis/#name-aead-encrypted-data-packet-">
|
||||
* AEAD Encrypted Data Packet</a>
|
||||
*/
|
||||
AEAD_ENCRYPTED_DATA(Features.FEATURE_AEAD_ENCRYPTED_DATA),
|
||||
GNUGP_AEAD_ENCRYPTED_DATA(Features.FEATURE_AEAD_ENCRYPTED_DATA),
|
||||
|
||||
/**
|
||||
* If a key announces this feature, it is a version 5 public key.
|
||||
|
@ -56,7 +56,7 @@ public enum Feature {
|
|||
* @see <a href="https://openpgp-wg.gitlab.io/rfc4880bis/#name-public-key-packet-formats">
|
||||
* Public-Key Packet Formats</a>
|
||||
*/
|
||||
VERSION_5_PUBLIC_KEY(Features.FEATURE_VERSION_5_PUBLIC_KEY),
|
||||
GNUPG_VERSION_5_PUBLIC_KEY(Features.FEATURE_VERSION_5_PUBLIC_KEY),
|
||||
|
||||
/**
|
||||
* Support for Symmetrically Encrypted Integrity Protected Data packet version 2.
|
||||
|
|
|
@ -140,7 +140,7 @@ public class SignatureSubpacketsUtilTest {
|
|||
|
||||
PGPSignatureGenerator generator = getSignatureGenerator(certKey, SignatureType.CASUAL_CERTIFICATION);
|
||||
PGPSignatureSubpacketGenerator hashed = new PGPSignatureSubpacketGenerator();
|
||||
hashed.setFeature(true, Feature.toBitmask(Feature.MODIFICATION_DETECTION, Feature.AEAD_ENCRYPTED_DATA));
|
||||
hashed.setFeature(true, Feature.toBitmask(Feature.MODIFICATION_DETECTION, Feature.GNUGP_AEAD_ENCRYPTED_DATA));
|
||||
generator.setHashedSubpackets(hashed.generate());
|
||||
|
||||
PGPSignature signature = generator.generateCertification(secretKeys.getPublicKey());
|
||||
|
@ -148,8 +148,8 @@ public class SignatureSubpacketsUtilTest {
|
|||
assertNotNull(featureSet);
|
||||
assertEquals(2, featureSet.size());
|
||||
assertTrue(featureSet.contains(Feature.MODIFICATION_DETECTION));
|
||||
assertTrue(featureSet.contains(Feature.AEAD_ENCRYPTED_DATA));
|
||||
assertFalse(featureSet.contains(Feature.VERSION_5_PUBLIC_KEY));
|
||||
assertTrue(featureSet.contains(Feature.GNUGP_AEAD_ENCRYPTED_DATA));
|
||||
assertFalse(featureSet.contains(Feature.GNUPG_VERSION_5_PUBLIC_KEY));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -388,7 +388,7 @@ public class SignatureSubpacketsTest {
|
|||
|
||||
@Test
|
||||
public void testSetFeatures() {
|
||||
wrapper.setFeatures(Feature.MODIFICATION_DETECTION, Feature.AEAD_ENCRYPTED_DATA);
|
||||
wrapper.setFeatures(Feature.MODIFICATION_DETECTION, Feature.GNUGP_AEAD_ENCRYPTED_DATA);
|
||||
PGPSignatureSubpacketVector vector = SignatureSubpacketsHelper.toVector(wrapper);
|
||||
|
||||
Features features = vector.getFeatures();
|
||||
|
@ -476,7 +476,7 @@ public class SignatureSubpacketsTest {
|
|||
subpackets.setKeyFlags(true, KeyFlag.toBitmask(KeyFlag.SIGN_DATA, KeyFlag.CERTIFY_OTHER));
|
||||
subpackets.addSignerUserID(false, "alice@test.test");
|
||||
subpackets.setRevocationReason(true, RevocationAttributes.Reason.KEY_RETIRED.code(), "Key was retired.");
|
||||
subpackets.setFeature(true, Feature.toBitmask(Feature.MODIFICATION_DETECTION, Feature.AEAD_ENCRYPTED_DATA));
|
||||
subpackets.setFeature(true, Feature.toBitmask(Feature.MODIFICATION_DETECTION, Feature.GNUGP_AEAD_ENCRYPTED_DATA));
|
||||
byte[] hash = new byte[128];
|
||||
new Random().nextBytes(hash);
|
||||
subpackets.setSignatureTarget(false, publicKeys.getPublicKey().getAlgorithm(), HashAlgorithm.SHA512.getAlgorithmId(), hash);
|
||||
|
|
Loading…
Reference in a new issue