From d7e4fcaec6293881e2de3cb75fde9e8c7b5b38d5 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 11 Nov 2022 14:20:17 +0100 Subject: [PATCH] OpenPgpMessageInputStream: Source verification certs from ConsumerOptions.getCertificateSource() --- .../OpenPgpMessageInputStream.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/OpenPgpMessageInputStream.java b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/OpenPgpMessageInputStream.java index 28440257..65c8dad5 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/OpenPgpMessageInputStream.java +++ b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/OpenPgpMessageInputStream.java @@ -1018,11 +1018,9 @@ public class OpenPgpMessageInputStream extends DecryptionStream { } private PGPPublicKeyRing findCertificate(long keyId) { - for (PGPPublicKeyRing cert : options.getCertificates()) { - PGPPublicKey verificationKey = cert.getPublicKey(keyId); - if (verificationKey != null) { - return cert; - } + PGPPublicKeyRing cert = options.getCertificateSource().getCertificate(keyId); + if (cert != null) { + return cert; } if (options.getMissingCertificateCallback() != null) {