From a2bfb55d87c59b0273dcd84195cb8499eddcda1a Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 29 Aug 2022 13:22:44 +0200 Subject: [PATCH] Use *Options.get() factory methods in SOP module --- .../src/main/java/org/pgpainless/sop/DecryptImpl.java | 2 +- .../src/main/java/org/pgpainless/sop/DetachedSignImpl.java | 2 +- .../src/main/java/org/pgpainless/sop/DetachedVerifyImpl.java | 2 +- .../src/main/java/org/pgpainless/sop/EncryptImpl.java | 2 +- .../src/main/java/org/pgpainless/sop/InlineSignImpl.java | 2 +- .../src/main/java/org/pgpainless/sop/InlineVerifyImpl.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/DecryptImpl.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/DecryptImpl.java index 7d8481e3..4957f748 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/DecryptImpl.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/DecryptImpl.java @@ -35,7 +35,7 @@ import sop.operation.Decrypt; public class DecryptImpl implements Decrypt { - private final ConsumerOptions consumerOptions = new ConsumerOptions(); + private final ConsumerOptions consumerOptions = ConsumerOptions.get(); private final MatchMakingSecretKeyRingProtector protector = new MatchMakingSecretKeyRingProtector(); @Override diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/DetachedSignImpl.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/DetachedSignImpl.java index 704b5af5..0ce326a9 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/DetachedSignImpl.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/DetachedSignImpl.java @@ -39,7 +39,7 @@ public class DetachedSignImpl implements DetachedSign { private boolean armor = true; private SignAs mode = SignAs.Binary; - private final SigningOptions signingOptions = new SigningOptions(); + private final SigningOptions signingOptions = SigningOptions.get(); private final MatchMakingSecretKeyRingProtector protector = new MatchMakingSecretKeyRingProtector(); @Override diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/DetachedVerifyImpl.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/DetachedVerifyImpl.java index 81cb08ff..e6e2768e 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/DetachedVerifyImpl.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/DetachedVerifyImpl.java @@ -24,7 +24,7 @@ import sop.operation.DetachedVerify; public class DetachedVerifyImpl implements DetachedVerify { - private final ConsumerOptions options = new ConsumerOptions(); + private final ConsumerOptions options = ConsumerOptions.get(); @Override public DetachedVerify notBefore(Date timestamp) throws SOPGPException.UnsupportedOption { diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/EncryptImpl.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/EncryptImpl.java index 0843ae08..1b95d87c 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/EncryptImpl.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/EncryptImpl.java @@ -36,7 +36,7 @@ import sop.util.ProxyOutputStream; public class EncryptImpl implements Encrypt { - EncryptionOptions encryptionOptions = new EncryptionOptions(); + EncryptionOptions encryptionOptions = EncryptionOptions.get(); SigningOptions signingOptions = null; MatchMakingSecretKeyRingProtector protector = new MatchMakingSecretKeyRingProtector(); private final Set signingKeys = new HashSet<>(); diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineSignImpl.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineSignImpl.java index 639d8c6e..3bdc8fc3 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineSignImpl.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineSignImpl.java @@ -80,7 +80,7 @@ public class InlineSignImpl implements InlineSign { for (PGPSecretKeyRing key : signingKeys) { try { if (mode == InlineSignAs.CleartextSigned) { - signingOptions.addDetachedSignature(protector, key, DocumentSignatureType.BINARY_DOCUMENT); + signingOptions.addDetachedSignature(protector, key); } else { signingOptions.addInlineSignature(protector, key, modeToSigType(mode)); } diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineVerifyImpl.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineVerifyImpl.java index 7c31f44b..1e8c4fee 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineVerifyImpl.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineVerifyImpl.java @@ -26,7 +26,7 @@ import sop.operation.InlineVerify; public class InlineVerifyImpl implements InlineVerify { - private final ConsumerOptions options = new ConsumerOptions(); + private final ConsumerOptions options = ConsumerOptions.get(); @Override public InlineVerify notBefore(Date timestamp) throws SOPGPException.UnsupportedOption {