From 9dce460bd6d6c286c3a0b8fae2147e17356954bd Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Wed, 27 Jun 2018 15:48:53 +0200 Subject: [PATCH] Swap arguments in decryptionBuilder --- .../pgpainless/decryption_verification/DecryptionBuilder.java | 2 +- .../decryption_verification/DecryptionBuilderInterface.java | 2 +- .../de/vanitasvitae/crypto/pgpainless/EncryptDecryptTest.java | 2 +- .../java/de/vanitasvitae/crypto/pgpainless/TestKeysTest.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/vanitasvitae/crypto/pgpainless/decryption_verification/DecryptionBuilder.java b/src/main/java/de/vanitasvitae/crypto/pgpainless/decryption_verification/DecryptionBuilder.java index 5bf49c8d..e7f9f292 100644 --- a/src/main/java/de/vanitasvitae/crypto/pgpainless/decryption_verification/DecryptionBuilder.java +++ b/src/main/java/de/vanitasvitae/crypto/pgpainless/decryption_verification/DecryptionBuilder.java @@ -47,7 +47,7 @@ public class DecryptionBuilder implements DecryptionBuilderInterface { class DecryptWithImpl implements DecryptWith { @Override - public VerifyWith decryptWith(PGPSecretKeyRingCollection secretKeyRings, SecretKeyRingProtector decryptor) { + public VerifyWith decryptWith(SecretKeyRingProtector decryptor, PGPSecretKeyRingCollection secretKeyRings) { DecryptionBuilder.this.decryptionKeys = secretKeyRings; DecryptionBuilder.this.decryptionKeyDecryptor = decryptor; return new VerifyWithImpl(); diff --git a/src/main/java/de/vanitasvitae/crypto/pgpainless/decryption_verification/DecryptionBuilderInterface.java b/src/main/java/de/vanitasvitae/crypto/pgpainless/decryption_verification/DecryptionBuilderInterface.java index 9c50b220..6a60893d 100644 --- a/src/main/java/de/vanitasvitae/crypto/pgpainless/decryption_verification/DecryptionBuilderInterface.java +++ b/src/main/java/de/vanitasvitae/crypto/pgpainless/decryption_verification/DecryptionBuilderInterface.java @@ -31,7 +31,7 @@ public interface DecryptionBuilderInterface { interface DecryptWith { - VerifyWith decryptWith(PGPSecretKeyRingCollection secretKeyRings, SecretKeyRingProtector decryptor); + VerifyWith decryptWith(SecretKeyRingProtector decryptor, PGPSecretKeyRingCollection secretKeyRings); VerifyWith doNotDecrypt(); diff --git a/src/test/java/de/vanitasvitae/crypto/pgpainless/EncryptDecryptTest.java b/src/test/java/de/vanitasvitae/crypto/pgpainless/EncryptDecryptTest.java index 59fa9940..98eadd20 100644 --- a/src/test/java/de/vanitasvitae/crypto/pgpainless/EncryptDecryptTest.java +++ b/src/test/java/de/vanitasvitae/crypto/pgpainless/EncryptDecryptTest.java @@ -149,7 +149,7 @@ public class EncryptDecryptTest extends AbstractPGPainlessTest { ByteArrayInputStream envelopeIn = new ByteArrayInputStream(encryptedSecretMessage); DecryptionStream decryptor = PGPainless.createDecryptor() .onInputStream(envelopeIn) - .decryptWith(BCUtil.keyRingsToKeyRingCollection(recipient), keyDecryptor) + .decryptWith(keyDecryptor, BCUtil.keyRingsToKeyRingCollection(recipient)) .verifyWith(Collections.singleton(senderPub.getPublicKey().getKeyID()), BCUtil.keyRingsToKeyRingCollection(senderPub)) .ignoreMissingPublicKeys() diff --git a/src/test/java/de/vanitasvitae/crypto/pgpainless/TestKeysTest.java b/src/test/java/de/vanitasvitae/crypto/pgpainless/TestKeysTest.java index a2be05d4..e00ba18c 100644 --- a/src/test/java/de/vanitasvitae/crypto/pgpainless/TestKeysTest.java +++ b/src/test/java/de/vanitasvitae/crypto/pgpainless/TestKeysTest.java @@ -56,7 +56,7 @@ public class TestKeysTest extends AbstractPGPainlessTest { DecryptionStream decryptor = PGPainless.createDecryptor() .onInputStream(new ByteArrayInputStream(encryptedMessage.getBytes())) - .decryptWith(new PGPSecretKeyRingCollection(Collections.singleton(juliet)), new UnprotectedKeysProtector()) + .decryptWith(new UnprotectedKeysProtector(), new PGPSecretKeyRingCollection(Collections.singleton(juliet))) .verifyWith( Collections.singleton(juliet.getPublicKey().getKeyID()), BCUtil.keyRingsToKeyRingCollection(BCUtil.publicKeyRingFromSecretKeyRing(juliet)))