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:
parent
cf1881a140
commit
bd67d9c0fa
11 changed files with 12 additions and 12 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue