1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-13 20:29:39 +02:00

Allow specification of signature type

This commit is contained in:
Paul Schaub 2020-12-16 16:33:14 +01:00
parent aeed8bf705
commit 4870bda4f2
6 changed files with 47 additions and 15 deletions

View file

@ -142,6 +142,7 @@ public class EncryptDecryptTest {
.toRecipients(recipientPub)
.usingSecureAlgorithms()
.signWith(keyDecryptor, senderSec)
.signBinaryDocument()
.noArmor();
Streams.pipeAll(new ByteArrayInputStream(secretMessage), encryptor);
@ -197,6 +198,7 @@ public class EncryptDecryptTest {
.doNotEncrypt()
.createDetachedSignature()
.signWith(keyRingProtector, signingKeys)
.signBinaryDocument()
.noArmor();
Streams.pipeAll(inputStream, signer);
signer.close();
@ -238,6 +240,7 @@ public class EncryptDecryptTest {
EncryptionStream signer = PGPainless.encryptAndOrSign().onOutputStream(signOut)
.doNotEncrypt()
.signWith(keyRingProtector, signingKeys)
.signBinaryDocument()
.asciiArmor();
Streams.pipeAll(inputStream, signer);
signer.close();

View file

@ -26,7 +26,6 @@ import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
import jdk.nashorn.internal.ir.annotations.Ignore;
import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
@ -96,7 +95,6 @@ public class LengthTest {
encryptDecryptForSecretKeyRings(sender, recipient);
}
@Ignore
private void encryptDecryptForSecretKeyRings(PGPSecretKeyRing senderSec, PGPSecretKeyRing recipientSec)
throws PGPException,
IOException {
@ -117,6 +115,7 @@ public class LengthTest {
// .doNotEncrypt()
.usingSecureAlgorithms()
.signWith(keyDecryptor, senderSec)
.signBinaryDocument()
.noArmor();
Streams.pipeAll(new ByteArrayInputStream(secretMessage), encryptor);

View file

@ -182,6 +182,7 @@ public class ChangeSecretKeyRingPassphraseTest {
EncryptionStream stream = PGPainless.encryptAndOrSign().onOutputStream(dummy)
.doNotEncrypt()
.signWith(PasswordBasedSecretKeyRingProtector.forKey(keyRing, passphrase), keyRing)
.signBinaryDocument()
.noArmor();
Streams.pipeAll(new ByteArrayInputStream(dummyMessage.getBytes()), stream);