From 28e4bc44a1e738f6285a610856fb88214fe01880 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Sat, 22 Jul 2023 00:30:52 +0200 Subject: [PATCH] Further integration of pgpainless-wot --- .../decryption_verification/MessageMetadata.java | 2 +- .../encryption_signing/EncryptionOptions.java | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/MessageMetadata.java b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/MessageMetadata.java index 4b55f268..041a5437 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/MessageMetadata.java +++ b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/MessageMetadata.java @@ -107,7 +107,7 @@ public class MessageMetadata { } /** - * Return true, if the message was signed by a certificate for which we can authenticate a binding to the given userId. + * Return true, if the message was verifiably signed by a certificate for which we can authenticate a binding to the given userId. * * @param userId userId * @param email if true, treat the user-id as an email address and match all userIDs containing this address 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 b3293142..9d2aacee 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 @@ -115,6 +115,19 @@ public class EncryptionOptions { return new EncryptionOptions(EncryptionPurpose.STORAGE); } + /** + * Identify authenticatable certificates for the given user-ID by querying the {@link CertificateAuthority} for + * identifiable bindings. + * Add all acceptable bindings, whose trust amount is larger or equal to the target amount to the list of recipients. + * @param userId userId + * @param email if true, treat the user-ID as an email address and match all user-IDs containing the mail address + * @param authority certificate authority + * @return encryption options + */ + public EncryptionOptions addAuthenticatableRecipients(String userId, boolean email, CertificateAuthority authority) { + return addAuthenticatableRecipients(userId, email, authority, 120); + } + /** * Identify authenticatable certificates for the given user-ID by querying the {@link CertificateAuthority} for * identifiable bindings.