mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-12 19:59:38 +02:00
Rename EncryptionPurpose.STORAGE_AND_COMMUNICATION -> ANY
This commit is contained in:
parent
cf1881a140
commit
bd67d9c0fa
11 changed files with 12 additions and 12 deletions
|
@ -122,7 +122,7 @@ public class InvestigateMultiSEIPMessageHandlingTest {
|
|||
public void generateTestMessage() throws PGPException, IOException {
|
||||
PGPSecretKeyRing ring1 = PGPainless.readKeyRing().secretKeyRing(KEY1);
|
||||
KeyRingInfo info1 = PGPainless.inspectKeyRing(ring1);
|
||||
PGPPublicKey cryptKey1 = info1.getEncryptionSubkeys(EncryptionPurpose.STORAGE_AND_COMMUNICATIONS).get(0);
|
||||
PGPPublicKey cryptKey1 = info1.getEncryptionSubkeys(EncryptionPurpose.ANY).get(0);
|
||||
PGPSecretKey signKey1 = ring1.getSecretKey(info1.getSigningSubkeys().get(0).getKeyID());
|
||||
PGPSecretKeyRing ring2 = PGPainless.readKeyRing().secretKeyRing(KEY2);
|
||||
KeyRingInfo info2 = PGPainless.inspectKeyRing(ring2);
|
||||
|
|
|
@ -144,7 +144,7 @@ public class DecryptHiddenRecipientMessage {
|
|||
assertEquals(0, metadata.getRecipientKeyIds().size());
|
||||
|
||||
KeyRingInfo info = new KeyRingInfo(secretKeys);
|
||||
List<PGPPublicKey> encryptionKeys = info.getEncryptionSubkeys(EncryptionPurpose.STORAGE_AND_COMMUNICATIONS);
|
||||
List<PGPPublicKey> encryptionKeys = info.getEncryptionSubkeys(EncryptionPurpose.ANY);
|
||||
assertEquals(1, encryptionKeys.size());
|
||||
|
||||
assertEquals(new SubkeyIdentifier(secretKeys, encryptionKeys.get(0).getKeyID()), metadata.getDecryptionKey());
|
||||
|
|
|
@ -118,7 +118,7 @@ public class MissingPassphraseForDecryptionTest {
|
|||
@Test
|
||||
public void throwExceptionStrategy() throws PGPException, IOException {
|
||||
KeyRingInfo info = PGPainless.inspectKeyRing(secretKeys);
|
||||
List<PGPPublicKey> encryptionKeys = info.getEncryptionSubkeys(EncryptionPurpose.STORAGE_AND_COMMUNICATIONS);
|
||||
List<PGPPublicKey> encryptionKeys = info.getEncryptionSubkeys(EncryptionPurpose.ANY);
|
||||
|
||||
SecretKeyPassphraseProvider callback = new SecretKeyPassphraseProvider() {
|
||||
@Nullable
|
||||
|
|
|
@ -83,7 +83,7 @@ public class GenerateKeys {
|
|||
assertEquals(PublicKeyAlgorithm.EDDSA.getAlgorithmId(),
|
||||
keyInfo.getSigningSubkeys().get(0).getAlgorithm());
|
||||
assertEquals(PublicKeyAlgorithm.ECDH.getAlgorithmId(),
|
||||
keyInfo.getEncryptionSubkeys(EncryptionPurpose.STORAGE_AND_COMMUNICATIONS).get(0).getAlgorithm());
|
||||
keyInfo.getEncryptionSubkeys(EncryptionPurpose.ANY).get(0).getAlgorithm());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -56,7 +56,7 @@ public class ModifyKeys {
|
|||
|
||||
KeyRingInfo info = PGPainless.inspectKeyRing(secretKey);
|
||||
primaryKeyId = info.getKeyId();
|
||||
encryptionSubkeyId = info.getEncryptionSubkeys(EncryptionPurpose.STORAGE_AND_COMMUNICATIONS).get(0).getKeyID();
|
||||
encryptionSubkeyId = info.getEncryptionSubkeys(EncryptionPurpose.ANY).get(0).getKeyID();
|
||||
signingSubkeyId = info.getSigningSubkeys().get(0).getKeyID();
|
||||
}
|
||||
|
||||
|
|
|
@ -698,7 +698,7 @@ public class KeyRingInfoTest {
|
|||
|
||||
assertFalse(info.isKeyValidlyBound(unboundKey.getKeyId()));
|
||||
|
||||
List<PGPPublicKey> encryptionSubkeys = info.getEncryptionSubkeys(EncryptionPurpose.STORAGE_AND_COMMUNICATIONS);
|
||||
List<PGPPublicKey> encryptionSubkeys = info.getEncryptionSubkeys(EncryptionPurpose.ANY);
|
||||
assertTrue(encryptionSubkeys.stream().map(OpenPgpV4Fingerprint::new).noneMatch(f -> f.equals(unboundKey)),
|
||||
"Unbound subkey MUST NOT be considered a valid encryption subkey");
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public class TestTwoSubkeysEncryption {
|
|||
EncryptionStream encryptionStream = PGPainless.encryptAndOrSign()
|
||||
.onOutputStream(out)
|
||||
.withOptions(
|
||||
ProducerOptions.encrypt(new EncryptionOptions(EncryptionPurpose.STORAGE_AND_COMMUNICATIONS)
|
||||
ProducerOptions.encrypt(new EncryptionOptions(EncryptionPurpose.ANY)
|
||||
.addRecipient(publicKeys, EncryptionOptions.encryptToAllCapableSubkeys())
|
||||
)
|
||||
.setAsciiArmor(false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue