1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-12-10 22:31:09 +01:00

Rename EncryptionPurpose.STORAGE_AND_COMMUNICATION -> ANY

This commit is contained in:
Paul Schaub 2021-11-02 11:30:44 +01:00
parent cf1881a140
commit bd67d9c0fa
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
11 changed files with 12 additions and 12 deletions

View file

@ -11,12 +11,12 @@ public enum EncryptionPurpose {
*/
COMMUNICATIONS,
/**
* The stream will encrypt data that is stored on disk.
* The stream will encrypt data at rest.
* Eg. Encrypted backup...
*/
STORAGE,
/**
* The stream will use keys with either flags to encrypt the data.
*/
STORAGE_AND_COMMUNICATIONS
ANY
}

View file

@ -316,7 +316,7 @@ public final class DecryptionStreamFactory {
break;
}
KeyRingInfo info = new KeyRingInfo(secretKeys);
List<PGPPublicKey> encryptionSubkeys = info.getEncryptionSubkeys(EncryptionPurpose.STORAGE_AND_COMMUNICATIONS);
List<PGPPublicKey> encryptionSubkeys = info.getEncryptionSubkeys(EncryptionPurpose.ANY);
for (PGPPublicKey pubkey : encryptionSubkeys) {
PGPSecretKey secretKey = secretKeys.getSecretKey(pubkey.getKeyID());
// Skip missing secret key

View file

@ -71,7 +71,7 @@ public class EncryptionOptions {
* or {@link org.pgpainless.algorithm.KeyFlag#ENCRYPT_STORAGE}.
*/
public EncryptionOptions() {
this(EncryptionPurpose.STORAGE_AND_COMMUNICATIONS);
this(EncryptionPurpose.ANY);
}
public EncryptionOptions(EncryptionPurpose purpose) {

View file

@ -777,7 +777,7 @@ public class KeyRingInfo {
encryptionKeys.add(subKey);
}
break;
case STORAGE_AND_COMMUNICATIONS:
case ANY:
if (keyFlags.contains(KeyFlag.ENCRYPT_COMMS) || keyFlags.contains(KeyFlag.ENCRYPT_STORAGE)) {
encryptionKeys.add(subKey);
}