1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-26 06:12:06 +01:00

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