From 200e00990b82e3a253cfca027437b5b96b42c19c Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 23 Aug 2021 00:47:26 +0200 Subject: [PATCH] Remove unused class and move detached sig initialization in own method --- .../DecryptionStreamFactory.java | 6 +++++- .../decryption_verification/OpenPgpMetadata.java | 10 ---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStreamFactory.java b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStreamFactory.java index 0cd32968..0050e571 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStreamFactory.java +++ b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStreamFactory.java @@ -24,6 +24,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Set; import javax.annotation.Nonnull; import org.bouncycastle.bcpg.ArmoredInputStream; @@ -88,8 +89,11 @@ public final class DecryptionStreamFactory { public DecryptionStreamFactory(ConsumerOptions options) { this.options = options; + initializeDetachedSignatures(options.getDetachedSignatures()); + } - for (PGPSignature signature : options.getDetachedSignatures()) { + private void initializeDetachedSignatures(Set signatures) { + for (PGPSignature signature : signatures) { long issuerKeyId = SignatureUtils.determineIssuerKeyId(signature); PGPPublicKeyRing signingKeyRing = findSignatureVerificationKeyRing(issuerKeyId); if (signingKeyRing == null) { diff --git a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/OpenPgpMetadata.java b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/OpenPgpMetadata.java index be530170..ff956fc0 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/OpenPgpMetadata.java +++ b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/OpenPgpMetadata.java @@ -146,16 +146,6 @@ public class OpenPgpMetadata { return false; } - public static class Signature { - protected final PGPSignature signature; - protected final OpenPgpV4Fingerprint fingerprint; - - public Signature(PGPSignature signature, OpenPgpV4Fingerprint fingerprint) { - this.signature = signature; - this.fingerprint = fingerprint; - } - } - /** * Return the name of the encrypted / signed file. *