mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-02-16 22:26:25 +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 {
|
class DecryptWithImpl implements DecryptWith {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VerifyWith decryptWith(PGPSecretKeyRingCollection secretKeyRings, SecretKeyRingProtector decryptor) {
|
public VerifyWith decryptWith(SecretKeyRingProtector decryptor, PGPSecretKeyRingCollection secretKeyRings) {
|
||||||
DecryptionBuilder.this.decryptionKeys = secretKeyRings;
|
DecryptionBuilder.this.decryptionKeys = secretKeyRings;
|
||||||
DecryptionBuilder.this.decryptionKeyDecryptor = decryptor;
|
DecryptionBuilder.this.decryptionKeyDecryptor = decryptor;
|
||||||
return new VerifyWithImpl();
|
return new VerifyWithImpl();
|
||||||
|
|
|
@ -31,7 +31,7 @@ public interface DecryptionBuilderInterface {
|
||||||
|
|
||||||
interface DecryptWith {
|
interface DecryptWith {
|
||||||
|
|
||||||
VerifyWith decryptWith(PGPSecretKeyRingCollection secretKeyRings, SecretKeyRingProtector decryptor);
|
VerifyWith decryptWith(SecretKeyRingProtector decryptor, PGPSecretKeyRingCollection secretKeyRings);
|
||||||
|
|
||||||
VerifyWith doNotDecrypt();
|
VerifyWith doNotDecrypt();
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ public class EncryptDecryptTest extends AbstractPGPainlessTest {
|
||||||
ByteArrayInputStream envelopeIn = new ByteArrayInputStream(encryptedSecretMessage);
|
ByteArrayInputStream envelopeIn = new ByteArrayInputStream(encryptedSecretMessage);
|
||||||
DecryptionStream decryptor = PGPainless.createDecryptor()
|
DecryptionStream decryptor = PGPainless.createDecryptor()
|
||||||
.onInputStream(envelopeIn)
|
.onInputStream(envelopeIn)
|
||||||
.decryptWith(BCUtil.keyRingsToKeyRingCollection(recipient), keyDecryptor)
|
.decryptWith(keyDecryptor, BCUtil.keyRingsToKeyRingCollection(recipient))
|
||||||
.verifyWith(Collections.singleton(senderPub.getPublicKey().getKeyID()),
|
.verifyWith(Collections.singleton(senderPub.getPublicKey().getKeyID()),
|
||||||
BCUtil.keyRingsToKeyRingCollection(senderPub))
|
BCUtil.keyRingsToKeyRingCollection(senderPub))
|
||||||
.ignoreMissingPublicKeys()
|
.ignoreMissingPublicKeys()
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class TestKeysTest extends AbstractPGPainlessTest {
|
||||||
|
|
||||||
DecryptionStream decryptor = PGPainless.createDecryptor()
|
DecryptionStream decryptor = PGPainless.createDecryptor()
|
||||||
.onInputStream(new ByteArrayInputStream(encryptedMessage.getBytes()))
|
.onInputStream(new ByteArrayInputStream(encryptedMessage.getBytes()))
|
||||||
.decryptWith(new PGPSecretKeyRingCollection(Collections.singleton(juliet)), new UnprotectedKeysProtector())
|
.decryptWith(new UnprotectedKeysProtector(), new PGPSecretKeyRingCollection(Collections.singleton(juliet)))
|
||||||
.verifyWith(
|
.verifyWith(
|
||||||
Collections.singleton(juliet.getPublicKey().getKeyID()),
|
Collections.singleton(juliet.getPublicKey().getKeyID()),
|
||||||
BCUtil.keyRingsToKeyRingCollection(BCUtil.publicKeyRingFromSecretKeyRing(juliet)))
|
BCUtil.keyRingsToKeyRingCollection(BCUtil.publicKeyRingFromSecretKeyRing(juliet)))
|
||||||
|
|
Loading…
Reference in a new issue