From 695e03f8b6cc01e0fc98b6ce2d9894f9f5e605d2 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 31 Jan 2023 18:19:08 +0100 Subject: [PATCH] Add EncryptionOptions.hasEncryptionMethod() --- .../encryption_signing/EncryptionOptions.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionOptions.java b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionOptions.java index 612dcd50..b5baee83 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionOptions.java +++ b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionOptions.java @@ -311,6 +311,16 @@ public class EncryptionOptions { return this; } + /** + * Return
true
iff the user specified at least one encryption method, + *
false
otherwise. + * + * @return encryption methods is not empty + */ + public boolean hasEncryptionMethod() { + return !encryptionMethods.isEmpty(); + } + public interface EncryptionKeySelector { List selectEncryptionSubkeys(List encryptionCapableKeys); }