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

EncryptDecryptRoundTripTest: make passphrase constant

This commit is contained in:
Paul Schaub 2022-06-23 11:47:20 +02:00
parent 0c28c7a389
commit efc0cb357b
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -28,6 +28,7 @@ public class EncryptDecryptRoundTripTest {
private static final Charset utf8 = Charset.forName("UTF8"); private static final Charset utf8 = Charset.forName("UTF8");
private static SOP sop; private static SOP sop;
private static byte[] aliceKey; private static byte[] aliceKey;
private static final String alicePassword = "wonderland.is.c00l";
private static byte[] aliceCert; private static byte[] aliceCert;
private static byte[] bobKey; private static byte[] bobKey;
private static byte[] bobCert; private static byte[] bobCert;
@ -38,7 +39,7 @@ public class EncryptDecryptRoundTripTest {
sop = new SOPImpl(); sop = new SOPImpl();
aliceKey = sop.generateKey() aliceKey = sop.generateKey()
.userId("Alice <alice@pgpainless.org>") .userId("Alice <alice@pgpainless.org>")
.withKeyPassword("wonderland.is.c00l") .withKeyPassword(alicePassword)
.generate() .generate()
.getBytes(); .getBytes();
aliceCert = sop.extractCert() aliceCert = sop.extractCert()
@ -57,7 +58,7 @@ public class EncryptDecryptRoundTripTest {
public void basicRoundTripWithKey() throws IOException, SOPGPException.KeyCannotSign { public void basicRoundTripWithKey() throws IOException, SOPGPException.KeyCannotSign {
byte[] encrypted = sop.encrypt() byte[] encrypted = sop.encrypt()
.signWith(aliceKey) .signWith(aliceKey)
.withKeyPassword("wonderland.is.c00l") .withKeyPassword(alicePassword)
.withCert(aliceCert) .withCert(aliceCert)
.withCert(bobCert) .withCert(bobCert)
.plaintext(message) .plaintext(message)