mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-22 12:22:06 +01:00
Swap arguments in decryptionBuilder
This commit is contained in:
parent
a8e51a47d5
commit
9dce460bd6
4 changed files with 4 additions and 4 deletions
|
@ -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();
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface DecryptionBuilderInterface {
|
|||
|
||||
interface DecryptWith {
|
||||
|
||||
VerifyWith decryptWith(PGPSecretKeyRingCollection secretKeyRings, SecretKeyRingProtector decryptor);
|
||||
VerifyWith decryptWith(SecretKeyRingProtector decryptor, PGPSecretKeyRingCollection secretKeyRings);
|
||||
|
||||
VerifyWith doNotDecrypt();
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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)))
|
||||
|
|
Loading…
Reference in a new issue