Swap arguments in decryptionBuilder

This commit is contained in:
Paul Schaub 2018-06-27 15:48:53 +02:00
parent a8e51a47d5
commit 9dce460bd6
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
4 changed files with 4 additions and 4 deletions

View File

@ -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();

View File

@ -31,7 +31,7 @@ public interface DecryptionBuilderInterface {
interface DecryptWith {
VerifyWith decryptWith(PGPSecretKeyRingCollection secretKeyRings, SecretKeyRingProtector decryptor);
VerifyWith decryptWith(SecretKeyRingProtector decryptor, PGPSecretKeyRingCollection secretKeyRings);
VerifyWith doNotDecrypt();

View File

@ -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()

View File

@ -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)))