mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-26 22:32:07 +01:00
rename invocationContextProvider to TestAllImplementations
This commit is contained in:
parent
c331dee6b1
commit
cf90c25afc
36 changed files with 146 additions and 146 deletions
|
@ -22,13 +22,13 @@ import org.bouncycastle.util.io.Streams;
|
||||||
import org.junit.jupiter.api.TestTemplate;
|
import org.junit.jupiter.api.TestTemplate;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.pgpainless.implementation.ImplementationFactory;
|
import org.pgpainless.implementation.ImplementationFactory;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
import org.pgpainless.util.PGPUtilWrapper;
|
import org.pgpainless.util.PGPUtilWrapper;
|
||||||
|
|
||||||
public class PGPUtilWrapperTest {
|
public class PGPUtilWrapperTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testGetDecoderStream() throws IOException {
|
public void testGetDecoderStream() throws IOException {
|
||||||
|
|
||||||
ByteArrayInputStream msg = new ByteArrayInputStream("Foo\nBar".getBytes(StandardCharsets.UTF_8));
|
ByteArrayInputStream msg = new ByteArrayInputStream("Foo\nBar".getBytes(StandardCharsets.UTF_8));
|
||||||
|
|
|
@ -25,7 +25,7 @@ import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
import org.pgpainless.key.SubkeyIdentifier;
|
import org.pgpainless.key.SubkeyIdentifier;
|
||||||
import org.pgpainless.key.TestKeys;
|
import org.pgpainless.key.TestKeys;
|
||||||
import org.pgpainless.key.util.KeyRingUtils;
|
import org.pgpainless.key.util.KeyRingUtils;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class DecryptAndVerifyMessageTest {
|
public class DecryptAndVerifyMessageTest {
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ public class DecryptAndVerifyMessageTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void decryptMessageAndVerifySignatureTest() throws Exception {
|
public void decryptMessageAndVerifySignatureTest() throws Exception {
|
||||||
String encryptedMessage = TestKeys.MSG_SIGN_CRYPT_JULIET_JULIET;
|
String encryptedMessage = TestKeys.MSG_SIGN_CRYPT_JULIET_JULIET;
|
||||||
|
|
||||||
|
|
|
@ -22,12 +22,12 @@ import org.pgpainless.PGPainless;
|
||||||
import org.pgpainless.algorithm.EncryptionPurpose;
|
import org.pgpainless.algorithm.EncryptionPurpose;
|
||||||
import org.pgpainless.key.SubkeyIdentifier;
|
import org.pgpainless.key.SubkeyIdentifier;
|
||||||
import org.pgpainless.key.info.KeyRingInfo;
|
import org.pgpainless.key.info.KeyRingInfo;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class DecryptHiddenRecipientMessage {
|
public class DecryptHiddenRecipientMessage {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testDecryptionWithWildcardRecipient() throws IOException, PGPException {
|
public void testDecryptionWithWildcardRecipient() throws IOException, PGPException {
|
||||||
String secretKeyAscii = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n" +
|
String secretKeyAscii = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n" +
|
||||||
"Comment: Bob's OpenPGP Transferable Secret Key\n" +
|
"Comment: Bob's OpenPGP Transferable Secret Key\n" +
|
||||||
|
|
|
@ -24,7 +24,7 @@ import org.pgpainless.PGPainless;
|
||||||
import org.pgpainless.exception.MessageNotIntegrityProtectedException;
|
import org.pgpainless.exception.MessageNotIntegrityProtectedException;
|
||||||
import org.pgpainless.exception.ModificationDetectionException;
|
import org.pgpainless.exception.ModificationDetectionException;
|
||||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
import org.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
public class ModificationDetectionTests {
|
public class ModificationDetectionTests {
|
||||||
|
@ -208,7 +208,7 @@ public class ModificationDetectionTests {
|
||||||
* @throws PGPException in case of a pgp error
|
* @throws PGPException in case of a pgp error
|
||||||
*/
|
*/
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testMissingMDCThrowsByDefault() throws IOException, PGPException {
|
public void testMissingMDCThrowsByDefault() throws IOException, PGPException {
|
||||||
|
|
||||||
PGPSecretKeyRingCollection secretKeyRings = getDecryptionKey();
|
PGPSecretKeyRingCollection secretKeyRings = getDecryptionKey();
|
||||||
|
@ -228,7 +228,7 @@ public class ModificationDetectionTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testTamperedCiphertextThrows() throws IOException, PGPException {
|
public void testTamperedCiphertextThrows() throws IOException, PGPException {
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_TAMPERED_CIPHERTEXT.getBytes(StandardCharsets.UTF_8));
|
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_TAMPERED_CIPHERTEXT.getBytes(StandardCharsets.UTF_8));
|
||||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||||
|
@ -243,7 +243,7 @@ public class ModificationDetectionTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testIgnoreTamperedCiphertext() throws IOException, PGPException {
|
public void testIgnoreTamperedCiphertext() throws IOException, PGPException {
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_TAMPERED_CIPHERTEXT.getBytes(StandardCharsets.UTF_8));
|
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_TAMPERED_CIPHERTEXT.getBytes(StandardCharsets.UTF_8));
|
||||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||||
|
@ -259,7 +259,7 @@ public class ModificationDetectionTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testTamperedMDCThrowsByDefault() throws IOException, PGPException {
|
public void testTamperedMDCThrowsByDefault() throws IOException, PGPException {
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_TAMPERED_MDC.getBytes(StandardCharsets.UTF_8));
|
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_TAMPERED_MDC.getBytes(StandardCharsets.UTF_8));
|
||||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||||
|
@ -274,7 +274,7 @@ public class ModificationDetectionTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testIgnoreTamperedMDC() throws IOException, PGPException {
|
public void testIgnoreTamperedMDC() throws IOException, PGPException {
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_TAMPERED_MDC.getBytes(StandardCharsets.UTF_8));
|
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_TAMPERED_MDC.getBytes(StandardCharsets.UTF_8));
|
||||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||||
|
@ -289,7 +289,7 @@ public class ModificationDetectionTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testTruncatedMDCThrows() throws IOException, PGPException {
|
public void testTruncatedMDCThrows() throws IOException, PGPException {
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_TRUNCATED_MDC.getBytes(StandardCharsets.UTF_8));
|
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_TRUNCATED_MDC.getBytes(StandardCharsets.UTF_8));
|
||||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||||
|
@ -303,7 +303,7 @@ public class ModificationDetectionTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testMDCWithBadCTBThrows() throws IOException, PGPException {
|
public void testMDCWithBadCTBThrows() throws IOException, PGPException {
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_MDC_WITH_BAD_CTB.getBytes(StandardCharsets.UTF_8));
|
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_MDC_WITH_BAD_CTB.getBytes(StandardCharsets.UTF_8));
|
||||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||||
|
@ -318,7 +318,7 @@ public class ModificationDetectionTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testIgnoreMDCWithBadCTB() throws IOException, PGPException {
|
public void testIgnoreMDCWithBadCTB() throws IOException, PGPException {
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_MDC_WITH_BAD_CTB.getBytes(StandardCharsets.UTF_8));
|
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_MDC_WITH_BAD_CTB.getBytes(StandardCharsets.UTF_8));
|
||||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||||
|
@ -334,7 +334,7 @@ public class ModificationDetectionTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testMDCWithBadLengthThrows() throws IOException, PGPException {
|
public void testMDCWithBadLengthThrows() throws IOException, PGPException {
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_MDC_WITH_BAD_LENGTH.getBytes(StandardCharsets.UTF_8));
|
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_MDC_WITH_BAD_LENGTH.getBytes(StandardCharsets.UTF_8));
|
||||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||||
|
@ -349,7 +349,7 @@ public class ModificationDetectionTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testIgnoreMDCWithBadLength() throws IOException, PGPException {
|
public void testIgnoreMDCWithBadLength() throws IOException, PGPException {
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_MDC_WITH_BAD_LENGTH.getBytes(StandardCharsets.UTF_8));
|
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_MDC_WITH_BAD_LENGTH.getBytes(StandardCharsets.UTF_8));
|
||||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||||
|
@ -365,7 +365,7 @@ public class ModificationDetectionTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void decryptMessageWithSEDPacket() throws IOException {
|
public void decryptMessageWithSEDPacket() throws IOException {
|
||||||
Passphrase passphrase = Passphrase.fromPassword("flowcrypt compatibility tests");
|
Passphrase passphrase = Passphrase.fromPassword("flowcrypt compatibility tests");
|
||||||
String key = "-----BEGIN PGP PRIVATE KEY BLOCK-----\r\n" +
|
String key = "-----BEGIN PGP PRIVATE KEY BLOCK-----\r\n" +
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.bouncycastle.util.io.Streams;
|
||||||
import org.junit.jupiter.api.TestTemplate;
|
import org.junit.jupiter.api.TestTemplate;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.pgpainless.PGPainless;
|
import org.pgpainless.PGPainless;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class RecursionDepthTest {
|
public class RecursionDepthTest {
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ public class RecursionDepthTest {
|
||||||
* @see <a href="https://tests.sequoia-pgp.org/#Maximum_recursion_depth">Sequoia-PGP Test Suite</a>
|
* @see <a href="https://tests.sequoia-pgp.org/#Maximum_recursion_depth">Sequoia-PGP Test Suite</a>
|
||||||
*/
|
*/
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void decryptionAbortsWhenMaximumRecursionDepthReachedTest()
|
public void decryptionAbortsWhenMaximumRecursionDepthReachedTest()
|
||||||
throws IOException {
|
throws IOException {
|
||||||
String key = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n" +
|
||||||
|
|
|
@ -46,7 +46,7 @@ import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||||
import org.pgpainless.key.util.KeyRingUtils;
|
import org.pgpainless.key.util.KeyRingUtils;
|
||||||
import org.pgpainless.policy.Policy;
|
import org.pgpainless.policy.Policy;
|
||||||
import org.pgpainless.util.ArmoredOutputStreamFactory;
|
import org.pgpainless.util.ArmoredOutputStreamFactory;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class EncryptDecryptTest {
|
public class EncryptDecryptTest {
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ public class EncryptDecryptTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void freshKeysRsaToElGamalTest()
|
public void freshKeysRsaToElGamalTest()
|
||||||
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
|
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
|
||||||
PGPSecretKeyRing sender = PGPainless.generateKeyRing().simpleRsaKeyRing("romeo@montague.lit", RsaLength._3072);
|
PGPSecretKeyRing sender = PGPainless.generateKeyRing().simpleRsaKeyRing("romeo@montague.lit", RsaLength._3072);
|
||||||
|
@ -87,7 +87,7 @@ public class EncryptDecryptTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void freshKeysRsaToRsaTest()
|
public void freshKeysRsaToRsaTest()
|
||||||
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
|
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
|
||||||
PGPSecretKeyRing sender = PGPainless.generateKeyRing().simpleRsaKeyRing("romeo@montague.lit", RsaLength._3072);
|
PGPSecretKeyRing sender = PGPainless.generateKeyRing().simpleRsaKeyRing("romeo@montague.lit", RsaLength._3072);
|
||||||
|
@ -97,7 +97,7 @@ public class EncryptDecryptTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void freshKeysEcToEcTest()
|
public void freshKeysEcToEcTest()
|
||||||
throws IOException, PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException {
|
throws IOException, PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException {
|
||||||
PGPSecretKeyRing sender = PGPainless.generateKeyRing().simpleEcKeyRing("romeo@montague.lit");
|
PGPSecretKeyRing sender = PGPainless.generateKeyRing().simpleEcKeyRing("romeo@montague.lit");
|
||||||
|
@ -107,7 +107,7 @@ public class EncryptDecryptTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void freshKeysEcToRsaTest()
|
public void freshKeysEcToRsaTest()
|
||||||
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
|
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
|
||||||
PGPSecretKeyRing sender = PGPainless.generateKeyRing().simpleEcKeyRing("romeo@montague.lit");
|
PGPSecretKeyRing sender = PGPainless.generateKeyRing().simpleEcKeyRing("romeo@montague.lit");
|
||||||
|
@ -117,7 +117,7 @@ public class EncryptDecryptTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void freshKeysRsaToEcTest()
|
public void freshKeysRsaToEcTest()
|
||||||
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
|
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
|
||||||
PGPSecretKeyRing sender = PGPainless.generateKeyRing().simpleRsaKeyRing("romeo@montague.lit", RsaLength._3072);
|
PGPSecretKeyRing sender = PGPainless.generateKeyRing().simpleRsaKeyRing("romeo@montague.lit", RsaLength._3072);
|
||||||
|
@ -127,7 +127,7 @@ public class EncryptDecryptTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void existingRsaKeysTest() throws IOException, PGPException {
|
public void existingRsaKeysTest() throws IOException, PGPException {
|
||||||
PGPSecretKeyRing sender = TestKeys.getJulietSecretKeyRing();
|
PGPSecretKeyRing sender = TestKeys.getJulietSecretKeyRing();
|
||||||
PGPSecretKeyRing recipient = TestKeys.getRomeoSecretKeyRing();
|
PGPSecretKeyRing recipient = TestKeys.getRomeoSecretKeyRing();
|
||||||
|
@ -191,7 +191,7 @@ public class EncryptDecryptTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testDetachedSignatureCreationAndVerification() throws IOException, PGPException {
|
public void testDetachedSignatureCreationAndVerification() throws IOException, PGPException {
|
||||||
|
|
||||||
PGPSecretKeyRing signingKeys = TestKeys.getJulietSecretKeyRing();
|
PGPSecretKeyRing signingKeys = TestKeys.getJulietSecretKeyRing();
|
||||||
|
@ -236,7 +236,7 @@ public class EncryptDecryptTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testOnePassSignatureCreationAndVerification() throws IOException, PGPException {
|
public void testOnePassSignatureCreationAndVerification() throws IOException, PGPException {
|
||||||
PGPSecretKeyRing signingKeys = TestKeys.getJulietSecretKeyRing();
|
PGPSecretKeyRing signingKeys = TestKeys.getJulietSecretKeyRing();
|
||||||
SecretKeyRingProtector keyRingProtector = new UnprotectedKeysProtector();
|
SecretKeyRingProtector keyRingProtector = new UnprotectedKeysProtector();
|
||||||
|
@ -266,7 +266,7 @@ public class EncryptDecryptTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void expiredSubkeyBacksigTest() throws IOException {
|
public void expiredSubkeyBacksigTest() throws IOException {
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
|
|
|
@ -14,13 +14,13 @@ import org.bouncycastle.openpgp.PGPException;
|
||||||
import org.junit.jupiter.api.TestTemplate;
|
import org.junit.jupiter.api.TestTemplate;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.pgpainless.PGPainless;
|
import org.pgpainless.PGPainless;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
import org.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
public class EncryptionStreamClosedTest {
|
public class EncryptionStreamClosedTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testStreamHasToBeClosedBeforeGetResultCanBeCalled() throws IOException, PGPException {
|
public void testStreamHasToBeClosedBeforeGetResultCanBeCalled() throws IOException, PGPException {
|
||||||
OutputStream out = new ByteArrayOutputStream();
|
OutputStream out = new ByteArrayOutputStream();
|
||||||
EncryptionStream stream = PGPainless.encryptAndOrSign()
|
EncryptionStream stream = PGPainless.encryptAndOrSign()
|
||||||
|
|
|
@ -45,14 +45,14 @@ import org.pgpainless.key.generation.type.eddsa.EdDSACurve;
|
||||||
import org.pgpainless.key.info.KeyRingInfo;
|
import org.pgpainless.key.info.KeyRingInfo;
|
||||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||||
import org.pgpainless.key.util.KeyRingUtils;
|
import org.pgpainless.key.util.KeyRingUtils;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
import org.pgpainless.util.MultiMap;
|
import org.pgpainless.util.MultiMap;
|
||||||
import org.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
public class SigningTest {
|
public class SigningTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testEncryptionAndSignatureVerification()
|
public void testEncryptionAndSignatureVerification()
|
||||||
throws IOException, PGPException {
|
throws IOException, PGPException {
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ public class SigningTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testSignWithInvalidUserIdFails()
|
public void testSignWithInvalidUserIdFails()
|
||||||
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||||
PGPSecretKeyRing secretKeys = PGPainless.generateKeyRing()
|
PGPSecretKeyRing secretKeys = PGPainless.generateKeyRing()
|
||||||
|
@ -131,7 +131,7 @@ public class SigningTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testSignWithRevokedUserIdFails()
|
public void testSignWithRevokedUserIdFails()
|
||||||
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||||
PGPSecretKeyRing secretKeys = PGPainless.generateKeyRing()
|
PGPSecretKeyRing secretKeys = PGPainless.generateKeyRing()
|
||||||
|
@ -152,7 +152,7 @@ public class SigningTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void signWithHashAlgorithmOverride() throws PGPException, IOException {
|
public void signWithHashAlgorithmOverride() throws PGPException, IOException {
|
||||||
PGPSecretKeyRing secretKeys = TestKeys.getEmilSecretKeyRing();
|
PGPSecretKeyRing secretKeys = TestKeys.getEmilSecretKeyRing();
|
||||||
SecretKeyRingProtector protector = SecretKeyRingProtector.unprotectedKeys();
|
SecretKeyRingProtector protector = SecretKeyRingProtector.unprotectedKeys();
|
||||||
|
@ -184,7 +184,7 @@ public class SigningTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void negotiateHashAlgorithmChoseFallbackIfEmptyPreferences()
|
public void negotiateHashAlgorithmChoseFallbackIfEmptyPreferences()
|
||||||
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IOException {
|
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IOException {
|
||||||
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
||||||
|
@ -214,7 +214,7 @@ public class SigningTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void negotiateHashAlgorithmChoseFallbackIfUnacceptablePreferences()
|
public void negotiateHashAlgorithmChoseFallbackIfUnacceptablePreferences()
|
||||||
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IOException {
|
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IOException {
|
||||||
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
||||||
|
@ -244,7 +244,7 @@ public class SigningTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void signingWithNonCapableKeyThrowsKeyCannotSignException()
|
public void signingWithNonCapableKeyThrowsKeyCannotSignException()
|
||||||
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||||
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
||||||
|
@ -260,7 +260,7 @@ public class SigningTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void signWithInvalidUserIdThrowsKeyValidationError()
|
public void signWithInvalidUserIdThrowsKeyValidationError()
|
||||||
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||||
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
||||||
|
|
|
@ -32,12 +32,12 @@ import org.bouncycastle.openpgp.operator.jcajce.JcaPGPKeyPair;
|
||||||
import org.junit.jupiter.api.TestTemplate;
|
import org.junit.jupiter.api.TestTemplate;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.pgpainless.provider.ProviderFactory;
|
import org.pgpainless.provider.ProviderFactory;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class BouncycastleExportSubkeys {
|
public class BouncycastleExportSubkeys {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testExportImport() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, PGPException {
|
public void testExportImport() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, PGPException {
|
||||||
KeyPairGenerator generator;
|
KeyPairGenerator generator;
|
||||||
KeyPair pair;
|
KeyPair pair;
|
||||||
|
|
|
@ -16,7 +16,7 @@ import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator;
|
||||||
import org.junit.jupiter.api.TestTemplate;
|
import org.junit.jupiter.api.TestTemplate;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.pgpainless.implementation.ImplementationFactory;
|
import org.pgpainless.implementation.ImplementationFactory;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class ImportExportKeyTest {
|
public class ImportExportKeyTest {
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ public class ImportExportKeyTest {
|
||||||
* @throws IOException in case of a IO error
|
* @throws IOException in case of a IO error
|
||||||
*/
|
*/
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testExportImportPublicKeyRing() throws IOException {
|
public void testExportImportPublicKeyRing() throws IOException {
|
||||||
PGPPublicKeyRing publicKeys = TestKeys.getJulietPublicKeyRing();
|
PGPPublicKeyRing publicKeys = TestKeys.getJulietPublicKeyRing();
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ public class ImportExportKeyTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testExportImportSecretKeyRing() throws IOException, PGPException {
|
public void testExportImportSecretKeyRing() throws IOException, PGPException {
|
||||||
PGPSecretKeyRing secretKeys = TestKeys.getRomeoSecretKeyRing();
|
PGPSecretKeyRing secretKeys = TestKeys.getRomeoSecretKeyRing();
|
||||||
|
|
||||||
|
|
|
@ -30,13 +30,13 @@ import org.pgpainless.key.generation.type.xdh.XDHSpec;
|
||||||
import org.pgpainless.key.info.KeyInfo;
|
import org.pgpainless.key.info.KeyInfo;
|
||||||
import org.pgpainless.key.util.UserId;
|
import org.pgpainless.key.util.UserId;
|
||||||
import org.pgpainless.util.BCUtil;
|
import org.pgpainless.util.BCUtil;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
import org.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
public class BrainpoolKeyGenerationTest {
|
public class BrainpoolKeyGenerationTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void generateEcKeysTest()
|
public void generateEcKeysTest()
|
||||||
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException {
|
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException {
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ public class BrainpoolKeyGenerationTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void generateEdDSAKeyTest()
|
public void generateEdDSAKeyTest()
|
||||||
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.pgpainless.algorithm.KeyFlag;
|
||||||
import org.pgpainless.key.generation.type.KeyType;
|
import org.pgpainless.key.generation.type.KeyType;
|
||||||
import org.pgpainless.key.generation.type.ecc.EllipticCurve;
|
import org.pgpainless.key.generation.type.ecc.EllipticCurve;
|
||||||
import org.pgpainless.key.generation.type.xdh.XDHSpec;
|
import org.pgpainless.key.generation.type.xdh.XDHSpec;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class CertificationKeyMustBeAbleToCertifyTest {
|
public class CertificationKeyMustBeAbleToCertifyTest {
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ public class CertificationKeyMustBeAbleToCertifyTest {
|
||||||
* This test therefore verifies that generating such keys fails.
|
* This test therefore verifies that generating such keys fails.
|
||||||
*/
|
*/
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testCertificationIncapableKeyTypesThrow() {
|
public void testCertificationIncapableKeyTypesThrow() {
|
||||||
KeyType[] typesIncapableOfCreatingVerifications = new KeyType[] {
|
KeyType[] typesIncapableOfCreatingVerifications = new KeyType[] {
|
||||||
KeyType.ECDH(EllipticCurve._P256),
|
KeyType.ECDH(EllipticCurve._P256),
|
||||||
|
|
|
@ -22,12 +22,12 @@ import org.pgpainless.key.generation.type.xdh.XDHSpec;
|
||||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||||
import org.pgpainless.key.util.UserId;
|
import org.pgpainless.key.util.UserId;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class GenerateEllipticCurveKeyTest {
|
public class GenerateEllipticCurveKeyTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void generateEllipticCurveKeys()
|
public void generateEllipticCurveKeys()
|
||||||
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException {
|
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException {
|
||||||
PGPSecretKeyRing keyRing = PGPainless.buildKeyRing()
|
PGPSecretKeyRing keyRing = PGPainless.buildKeyRing()
|
||||||
|
|
|
@ -26,12 +26,12 @@ import org.pgpainless.key.generation.type.rsa.RsaLength;
|
||||||
import org.pgpainless.key.util.KeyRingUtils;
|
import org.pgpainless.key.util.KeyRingUtils;
|
||||||
import org.pgpainless.key.util.UserId;
|
import org.pgpainless.key.util.UserId;
|
||||||
import org.pgpainless.util.DateUtil;
|
import org.pgpainless.util.DateUtil;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class GenerateKeyWithAdditionalUserIdTest {
|
public class GenerateKeyWithAdditionalUserIdTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void test() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, IOException {
|
public void test() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, IOException {
|
||||||
Date expiration = new Date(DateUtil.now().getTime() + 60 * 1000);
|
Date expiration = new Date(DateUtil.now().getTime() + 60 * 1000);
|
||||||
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
||||||
|
|
|
@ -16,7 +16,7 @@ import org.pgpainless.PGPainless;
|
||||||
import org.pgpainless.algorithm.KeyFlag;
|
import org.pgpainless.algorithm.KeyFlag;
|
||||||
import org.pgpainless.key.generation.type.KeyType;
|
import org.pgpainless.key.generation.type.KeyType;
|
||||||
import org.pgpainless.key.generation.type.rsa.RsaLength;
|
import org.pgpainless.key.generation.type.rsa.RsaLength;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
import org.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,7 +29,7 @@ import org.pgpainless.util.Passphrase;
|
||||||
public class GenerateWithEmptyPassphraseTest {
|
public class GenerateWithEmptyPassphraseTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testGeneratingKeyWithEmptyPassphraseDoesNotThrow()
|
public void testGeneratingKeyWithEmptyPassphraseDoesNotThrow()
|
||||||
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException {
|
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException {
|
||||||
|
|
||||||
|
|
|
@ -12,12 +12,12 @@ import org.pgpainless.algorithm.KeyFlag;
|
||||||
import org.pgpainless.key.generation.type.KeyType;
|
import org.pgpainless.key.generation.type.KeyType;
|
||||||
import org.pgpainless.key.generation.type.eddsa.EdDSACurve;
|
import org.pgpainless.key.generation.type.eddsa.EdDSACurve;
|
||||||
import org.pgpainless.key.generation.type.xdh.XDHSpec;
|
import org.pgpainless.key.generation.type.xdh.XDHSpec;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class IllegalKeyFlagsTest {
|
public class IllegalKeyFlagsTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testKeyCannotCarryFlagsTest() {
|
public void testKeyCannotCarryFlagsTest() {
|
||||||
assertThrows(IllegalArgumentException.class, () -> KeySpec.getBuilder(
|
assertThrows(IllegalArgumentException.class, () -> KeySpec.getBuilder(
|
||||||
KeyType.XDH(XDHSpec._X25519), KeyFlag.SIGN_DATA));
|
KeyType.XDH(XDHSpec._X25519), KeyFlag.SIGN_DATA));
|
||||||
|
|
|
@ -51,13 +51,13 @@ import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||||
import org.pgpainless.key.util.KeyRingUtils;
|
import org.pgpainless.key.util.KeyRingUtils;
|
||||||
import org.pgpainless.key.util.UserId;
|
import org.pgpainless.key.util.UserId;
|
||||||
import org.pgpainless.util.DateUtil;
|
import org.pgpainless.util.DateUtil;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
import org.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
public class KeyRingInfoTest {
|
public class KeyRingInfoTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testWithEmilsKeys() throws IOException, PGPException {
|
public void testWithEmilsKeys() throws IOException, PGPException {
|
||||||
|
|
||||||
PGPSecretKeyRing secretKeys = TestKeys.getEmilSecretKeyRing();
|
PGPSecretKeyRing secretKeys = TestKeys.getEmilSecretKeyRing();
|
||||||
|
@ -174,7 +174,7 @@ public class KeyRingInfoTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void dummyS2KTest() throws IOException {
|
public void dummyS2KTest() throws IOException {
|
||||||
|
|
||||||
String withDummyS2K = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n" +
|
String withDummyS2K = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n" +
|
||||||
|
@ -212,7 +212,7 @@ public class KeyRingInfoTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testGetKeysWithFlagsAndExpiry() throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
public void testGetKeysWithFlagsAndExpiry() throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||||
|
|
||||||
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
||||||
|
|
|
@ -32,13 +32,13 @@ import org.pgpainless.key.info.KeyRingInfo;
|
||||||
import org.pgpainless.key.protection.PasswordBasedSecretKeyRingProtector;
|
import org.pgpainless.key.protection.PasswordBasedSecretKeyRingProtector;
|
||||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
import org.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
public class AddSubKeyTest {
|
public class AddSubKeyTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testAddSubKey()
|
public void testAddSubKey()
|
||||||
throws IOException, PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
throws IOException, PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||||
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
|
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
|
||||||
|
|
|
@ -27,13 +27,13 @@ import org.pgpainless.key.protection.PasswordBasedSecretKeyRingProtector;
|
||||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||||
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||||
import org.pgpainless.key.util.UserId;
|
import org.pgpainless.key.util.UserId;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
import org.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
public class AddUserIdTest {
|
public class AddUserIdTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void addUserIdToExistingKeyRing()
|
public void addUserIdToExistingKeyRing()
|
||||||
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException {
|
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException {
|
||||||
PGPSecretKeyRing secretKeys = PGPainless.generateKeyRing().simpleEcKeyRing("alice@wonderland.lit", "rabb1th0le");
|
PGPSecretKeyRing secretKeys = PGPainless.generateKeyRing().simpleEcKeyRing("alice@wonderland.lit", "rabb1th0le");
|
||||||
|
@ -65,7 +65,7 @@ public class AddUserIdTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void deleteUserId_noSuchElementExceptionForMissingUserId() throws IOException, PGPException {
|
public void deleteUserId_noSuchElementExceptionForMissingUserId() throws IOException, PGPException {
|
||||||
|
|
||||||
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
|
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
|
||||||
|
@ -74,7 +74,7 @@ public class AddUserIdTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void deleteExistingAndAddNewUserIdToExistingKeyRing() throws PGPException, IOException {
|
public void deleteExistingAndAddNewUserIdToExistingKeyRing() throws PGPException, IOException {
|
||||||
|
|
||||||
final String ARMORED_PRIVATE_KEY =
|
final String ARMORED_PRIVATE_KEY =
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.pgpainless.PGPainless;
|
import org.pgpainless.PGPainless;
|
||||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||||
import org.pgpainless.util.DateUtil;
|
import org.pgpainless.util.DateUtil;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class ChangeExpirationOnKeyWithDifferentSignatureTypesTest {
|
public class ChangeExpirationOnKeyWithDifferentSignatureTypesTest {
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ public class ChangeExpirationOnKeyWithDifferentSignatureTypesTest {
|
||||||
"-----END PGP PRIVATE KEY BLOCK-----";
|
"-----END PGP PRIVATE KEY BLOCK-----";
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void setExpirationDate_keyHasSigClass10()
|
public void setExpirationDate_keyHasSigClass10()
|
||||||
throws PGPException, IOException {
|
throws PGPException, IOException {
|
||||||
PGPSecretKeyRing keys = PGPainless.readKeyRing().secretKeyRing(keyWithGenericCertification);
|
PGPSecretKeyRing keys = PGPainless.readKeyRing().secretKeyRing(keyWithGenericCertification);
|
||||||
|
@ -145,7 +145,7 @@ public class ChangeExpirationOnKeyWithDifferentSignatureTypesTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void setExpirationDate_keyHasSigClass12()
|
public void setExpirationDate_keyHasSigClass12()
|
||||||
throws PGPException, IOException {
|
throws PGPException, IOException {
|
||||||
PGPSecretKeyRing keys = PGPainless.readKeyRing().secretKeyRing(keyWithCasualCertification);
|
PGPSecretKeyRing keys = PGPainless.readKeyRing().secretKeyRing(keyWithCasualCertification);
|
||||||
|
|
|
@ -21,14 +21,14 @@ import org.pgpainless.key.TestKeys;
|
||||||
import org.pgpainless.key.info.KeyRingInfo;
|
import org.pgpainless.key.info.KeyRingInfo;
|
||||||
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||||
import org.pgpainless.util.DateUtil;
|
import org.pgpainless.util.DateUtil;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class ChangeExpirationTest {
|
public class ChangeExpirationTest {
|
||||||
|
|
||||||
private final OpenPgpV4Fingerprint subKeyFingerprint = new OpenPgpV4Fingerprint("F73FDE6439ABE210B1AF4EDD273EF7A0C749807B");
|
private final OpenPgpV4Fingerprint subKeyFingerprint = new OpenPgpV4Fingerprint("F73FDE6439ABE210B1AF4EDD273EF7A0C749807B");
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void setExpirationDateAndThenUnsetIt_OnPrimaryKey()
|
public void setExpirationDateAndThenUnsetIt_OnPrimaryKey()
|
||||||
throws PGPException, IOException, InterruptedException {
|
throws PGPException, IOException, InterruptedException {
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public class ChangeExpirationTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void setExpirationDateAndThenUnsetIt_OnSubkey()
|
public void setExpirationDateAndThenUnsetIt_OnSubkey()
|
||||||
throws PGPException, IOException, InterruptedException {
|
throws PGPException, IOException, InterruptedException {
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ import org.pgpainless.implementation.ImplementationFactory;
|
||||||
import org.pgpainless.key.protection.KeyRingProtectionSettings;
|
import org.pgpainless.key.protection.KeyRingProtectionSettings;
|
||||||
import org.pgpainless.key.protection.PasswordBasedSecretKeyRingProtector;
|
import org.pgpainless.key.protection.PasswordBasedSecretKeyRingProtector;
|
||||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
import org.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
public class ChangeSecretKeyRingPassphraseTest {
|
public class ChangeSecretKeyRingPassphraseTest {
|
||||||
|
@ -43,7 +43,7 @@ public class ChangeSecretKeyRingPassphraseTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void changePassphraseOfWholeKeyRingTest() throws PGPException {
|
public void changePassphraseOfWholeKeyRingTest() throws PGPException {
|
||||||
|
|
||||||
PGPSecretKeyRing secretKeys = PGPainless.modifyKeyRing(keyRing)
|
PGPSecretKeyRing secretKeys = PGPainless.modifyKeyRing(keyRing)
|
||||||
|
@ -70,7 +70,7 @@ public class ChangeSecretKeyRingPassphraseTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void changePassphraseOfWholeKeyRingToEmptyPassphrase() throws PGPException, IOException {
|
public void changePassphraseOfWholeKeyRingToEmptyPassphrase() throws PGPException, IOException {
|
||||||
PGPSecretKeyRing secretKeys = PGPainless.modifyKeyRing(keyRing)
|
PGPSecretKeyRing secretKeys = PGPainless.modifyKeyRing(keyRing)
|
||||||
.changePassphraseFromOldPassphrase(Passphrase.fromPassword("weakPassphrase"))
|
.changePassphraseFromOldPassphrase(Passphrase.fromPassword("weakPassphrase"))
|
||||||
|
@ -87,7 +87,7 @@ public class ChangeSecretKeyRingPassphraseTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void changePassphraseOfSingleSubkeyToNewPassphrase() throws PGPException {
|
public void changePassphraseOfSingleSubkeyToNewPassphrase() throws PGPException {
|
||||||
|
|
||||||
Iterator<PGPSecretKey> keys = keyRing.getSecretKeys();
|
Iterator<PGPSecretKey> keys = keyRing.getSecretKeys();
|
||||||
|
@ -123,7 +123,7 @@ public class ChangeSecretKeyRingPassphraseTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void changePassphraseOfSingleSubkeyToEmptyPassphrase() throws PGPException {
|
public void changePassphraseOfSingleSubkeyToEmptyPassphrase() throws PGPException {
|
||||||
|
|
||||||
Iterator<PGPSecretKey> keys = keyRing.getSecretKeys();
|
Iterator<PGPSecretKey> keys = keyRing.getSecretKeys();
|
||||||
|
|
|
@ -21,12 +21,12 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.pgpainless.PGPainless;
|
import org.pgpainless.PGPainless;
|
||||||
import org.pgpainless.key.OpenPgpV4Fingerprint;
|
import org.pgpainless.key.OpenPgpV4Fingerprint;
|
||||||
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class OldSignatureSubpacketsArePreservedOnNewSig {
|
public class OldSignatureSubpacketsArePreservedOnNewSig {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void verifyOldSignatureSubpacketsArePreservedOnNewExpirationDateSig()
|
public void verifyOldSignatureSubpacketsArePreservedOnNewExpirationDateSig()
|
||||||
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, InterruptedException {
|
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, InterruptedException {
|
||||||
PGPSecretKeyRing secretKeys = PGPainless.generateKeyRing()
|
PGPSecretKeyRing secretKeys = PGPainless.generateKeyRing()
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.pgpainless.PGPainless;
|
import org.pgpainless.PGPainless;
|
||||||
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||||
import org.pgpainless.util.ArmoredOutputStreamFactory;
|
import org.pgpainless.util.ArmoredOutputStreamFactory;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test that makes sure that PGPainless can deal with keys that carry a key
|
* Test that makes sure that PGPainless can deal with keys that carry a key
|
||||||
|
@ -64,7 +64,7 @@ public class RevokeKeyWithGenericCertificationSignatureTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void test() throws IOException, PGPException {
|
public void test() throws IOException, PGPException {
|
||||||
revokeKey(SAMPLE_PRIVATE_KEY); // would crash previously
|
revokeKey(SAMPLE_PRIVATE_KEY); // would crash previously
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import org.pgpainless.key.modification.secretkeyring.SecretKeyRingEditorInterfac
|
||||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||||
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||||
import org.pgpainless.util.DateUtil;
|
import org.pgpainless.util.DateUtil;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class RevokeKeyWithoutPreferredAlgorithmsOnPrimaryKey {
|
public class RevokeKeyWithoutPreferredAlgorithmsOnPrimaryKey {
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public class RevokeKeyWithoutPreferredAlgorithmsOnPrimaryKey {
|
||||||
"-----END PGP PRIVATE KEY BLOCK-----";
|
"-----END PGP PRIVATE KEY BLOCK-----";
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testChangingExpirationTimeWithKeyWithoutPrefAlgos()
|
public void testChangingExpirationTimeWithKeyWithoutPrefAlgos()
|
||||||
throws IOException, PGPException {
|
throws IOException, PGPException {
|
||||||
Date expirationDate = DateUtil.parseUTCDate(DateUtil.formatUTCDate(new Date()));
|
Date expirationDate = DateUtil.parseUTCDate(DateUtil.formatUTCDate(new Date()));
|
||||||
|
|
|
@ -38,13 +38,13 @@ import org.pgpainless.key.util.RevocationAttributes;
|
||||||
import org.pgpainless.signature.SignatureUtils;
|
import org.pgpainless.signature.SignatureUtils;
|
||||||
import org.pgpainless.signature.subpackets.RevocationSignatureSubpackets;
|
import org.pgpainless.signature.subpackets.RevocationSignatureSubpackets;
|
||||||
import org.pgpainless.signature.subpackets.SignatureSubpacketsUtil;
|
import org.pgpainless.signature.subpackets.SignatureSubpacketsUtil;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
import org.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
public class RevokeSubKeyTest {
|
public class RevokeSubKeyTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void revokeSukeyTest() throws IOException, PGPException {
|
public void revokeSukeyTest() throws IOException, PGPException {
|
||||||
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
|
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ public class RevokeSubKeyTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void detachedRevokeSubkeyTest() throws IOException, PGPException {
|
public void detachedRevokeSubkeyTest() throws IOException, PGPException {
|
||||||
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
|
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
|
||||||
OpenPgpV4Fingerprint fingerprint = new OpenPgpV4Fingerprint(secretKeys);
|
OpenPgpV4Fingerprint fingerprint = new OpenPgpV4Fingerprint(secretKeys);
|
||||||
|
@ -88,7 +88,7 @@ public class RevokeSubKeyTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testRevocationSignatureTypeCorrect() throws IOException, PGPException {
|
public void testRevocationSignatureTypeCorrect() throws IOException, PGPException {
|
||||||
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
|
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
|
||||||
Iterator<PGPPublicKey> keysIterator = secretKeys.getPublicKeys();
|
Iterator<PGPPublicKey> keysIterator = secretKeys.getPublicKeys();
|
||||||
|
|
|
@ -28,13 +28,13 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.pgpainless.PGPainless;
|
import org.pgpainless.PGPainless;
|
||||||
import org.pgpainless.key.TestKeys;
|
import org.pgpainless.key.TestKeys;
|
||||||
import org.pgpainless.key.protection.passphrase_provider.SecretKeyPassphraseProvider;
|
import org.pgpainless.key.protection.passphrase_provider.SecretKeyPassphraseProvider;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
import org.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
public class SecretKeyRingProtectorTest {
|
public class SecretKeyRingProtectorTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testUnlockAllKeysWithSamePassword()
|
public void testUnlockAllKeysWithSamePassword()
|
||||||
throws IOException, PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
throws IOException, PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ public class SecretKeyRingProtectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testUnlockSingleKeyWithPassphrase()
|
public void testUnlockSingleKeyWithPassphrase()
|
||||||
throws IOException, PGPException {
|
throws IOException, PGPException {
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ import org.pgpainless.PGPainless;
|
||||||
import org.pgpainless.exception.SignatureValidationException;
|
import org.pgpainless.exception.SignatureValidationException;
|
||||||
import org.pgpainless.policy.Policy;
|
import org.pgpainless.policy.Policy;
|
||||||
import org.pgpainless.signature.consumer.CertificateValidator;
|
import org.pgpainless.signature.consumer.CertificateValidator;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Explores how subpackets on binding sigs are handled.
|
* Explores how subpackets on binding sigs are handled.
|
||||||
|
@ -52,7 +52,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
private Policy policy = PGPainless.getPolicy();
|
private Policy policy = PGPainless.getPolicy();
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void baseCase() throws IOException, PGPException {
|
public void baseCase() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -113,7 +113,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeyBindingIssuerFpOnly() throws IOException, PGPException {
|
public void subkeyBindingIssuerFpOnly() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -174,7 +174,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeyBindingIssuerV6IssuerFp() throws IOException, PGPException {
|
public void subkeyBindingIssuerV6IssuerFp() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -235,7 +235,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeyBindingIssuerFakeIssuer() throws IOException, PGPException {
|
public void subkeyBindingIssuerFakeIssuer() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -296,7 +296,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeyBindingFakeIssuerIssuer() throws IOException, PGPException {
|
public void subkeyBindingFakeIssuerIssuer() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -357,7 +357,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeyBindingFakeIssuer() throws IOException, PGPException {
|
public void subkeyBindingFakeIssuer() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -418,7 +418,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeyBindingNoIssuer() throws IOException, PGPException {
|
public void subkeyBindingNoIssuer() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -478,7 +478,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void unknownSubpacketHashed() throws IOException, PGPException {
|
public void unknownSubpacketHashed() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -539,7 +539,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeyBindingUnknownCriticalSubpacket() throws IOException, PGPException {
|
public void subkeyBindingUnknownCriticalSubpacket() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -600,7 +600,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeyBindingUnknownSubpacketUnhashed() throws IOException, PGPException {
|
public void subkeyBindingUnknownSubpacketUnhashed() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -661,7 +661,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeyBindingUnknownCriticalSubpacketUnhashed() throws IOException, PGPException {
|
public void subkeyBindingUnknownCriticalSubpacketUnhashed() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -722,7 +722,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeyBindingUnknownNotationHashed() throws IOException, PGPException {
|
public void subkeyBindingUnknownNotationHashed() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -784,7 +784,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeyBindingCriticalUnknownNotationHashed() throws IOException, PGPException {
|
public void subkeyBindingCriticalUnknownNotationHashed() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -846,7 +846,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeyBindingUnknownNotationUnhashed() throws IOException, PGPException {
|
public void subkeyBindingUnknownNotationUnhashed() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -908,7 +908,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeyBindingCriticalUnknownNotationUnhashed() throws IOException, PGPException {
|
public void subkeyBindingCriticalUnknownNotationUnhashed() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -970,7 +970,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeyBindingBackSigFakeBackSig() throws IOException, PGPException {
|
public void subkeyBindingBackSigFakeBackSig() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -1042,7 +1042,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeyBindingFakeBackSigBackSig() throws IOException, PGPException {
|
public void subkeyBindingFakeBackSigBackSig() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -1114,7 +1114,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void primaryBindingIssuerFpOnly() throws IOException, PGPException {
|
public void primaryBindingIssuerFpOnly() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -1175,7 +1175,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void primaryBindingIssuerV6IssuerFp() throws IOException, PGPException {
|
public void primaryBindingIssuerV6IssuerFp() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -1236,7 +1236,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void primaryBindingIssuerFakeIssuer() throws IOException, PGPException {
|
public void primaryBindingIssuerFakeIssuer() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -1297,7 +1297,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void primaryBindingFakeIssuerIssuer() throws IOException, PGPException {
|
public void primaryBindingFakeIssuerIssuer() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -1358,7 +1358,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void primaryBindingFakeIssuer() throws IOException, PGPException {
|
public void primaryBindingFakeIssuer() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -1419,7 +1419,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void primaryBindingNoIssuer() throws IOException, PGPException {
|
public void primaryBindingNoIssuer() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -1479,7 +1479,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void primaryBindingUnknownSubpacketHashed() throws IOException, PGPException {
|
public void primaryBindingUnknownSubpacketHashed() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -1540,7 +1540,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void primaryBindingCriticalUnknownSubpacketHashed() throws IOException, PGPException {
|
public void primaryBindingCriticalUnknownSubpacketHashed() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -1601,7 +1601,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void primaryBindingUnknownSubpacketUnhashed() throws IOException, PGPException {
|
public void primaryBindingUnknownSubpacketUnhashed() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -1662,7 +1662,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void primaryBindingCriticalUnknownSubpacketUnhashed() throws IOException, PGPException {
|
public void primaryBindingCriticalUnknownSubpacketUnhashed() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -1723,7 +1723,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void primaryBindingUnknownNotationHashed() throws IOException, PGPException {
|
public void primaryBindingUnknownNotationHashed() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -1785,7 +1785,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void primaryBindingCriticalUnknownNotationHashed() throws IOException, PGPException {
|
public void primaryBindingCriticalUnknownNotationHashed() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -1847,7 +1847,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void primaryBindingUnknownNotationUnhashed() throws IOException, PGPException {
|
public void primaryBindingUnknownNotationUnhashed() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
@ -1909,7 +1909,7 @@ public class BindingSignatureSubpacketsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void primaryBindingCriticalUnknownNotationUnhashed() throws IOException, PGPException {
|
public void primaryBindingCriticalUnknownNotationUnhashed() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
|
|
@ -28,7 +28,7 @@ import org.pgpainless.decryption_verification.OpenPgpMetadata;
|
||||||
import org.pgpainless.exception.SignatureValidationException;
|
import org.pgpainless.exception.SignatureValidationException;
|
||||||
import org.pgpainless.policy.Policy;
|
import org.pgpainless.policy.Policy;
|
||||||
import org.pgpainless.signature.consumer.CertificateValidator;
|
import org.pgpainless.signature.consumer.CertificateValidator;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class CertificateValidatorTest {
|
public class CertificateValidatorTest {
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ public class CertificateValidatorTest {
|
||||||
* @see <a href="https://tests.sequoia-pgp.org/#Key_revocation_test__primary_key_signs_and_is_revoked__revoked__unknown">Sequoia Test Suite</a>
|
* @see <a href="https://tests.sequoia-pgp.org/#Key_revocation_test__primary_key_signs_and_is_revoked__revoked__unknown">Sequoia Test Suite</a>
|
||||||
*/
|
*/
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testPrimaryKeySignsAndIsHardRevokedUnknown() throws IOException, PGPException {
|
public void testPrimaryKeySignsAndIsHardRevokedUnknown() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP ARMORED FILE-----\n" +
|
String key = "-----BEGIN PGP ARMORED FILE-----\n" +
|
||||||
|
@ -189,7 +189,7 @@ public class CertificateValidatorTest {
|
||||||
* @see <a href="https://tests.sequoia-pgp.org/#Key_revocation_test__subkey_signs__primary_key_is_revoked__revoked__unknown">Sequoia Test Suite</a>
|
* @see <a href="https://tests.sequoia-pgp.org/#Key_revocation_test__subkey_signs__primary_key_is_revoked__revoked__unknown">Sequoia Test Suite</a>
|
||||||
*/
|
*/
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testSubkeySignsPrimaryKeyIsHardRevokedUnknown() throws IOException, PGPException {
|
public void testSubkeySignsPrimaryKeyIsHardRevokedUnknown() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP ARMORED FILE-----\n" +
|
String key = "-----BEGIN PGP ARMORED FILE-----\n" +
|
||||||
|
@ -341,7 +341,7 @@ public class CertificateValidatorTest {
|
||||||
* @see <a href="https://tests.sequoia-pgp.org/#Key_revocation_test__subkey_signs__subkey_is_revoked__revoked__unknown">Sequoia Test Suite</a>
|
* @see <a href="https://tests.sequoia-pgp.org/#Key_revocation_test__subkey_signs__subkey_is_revoked__revoked__unknown">Sequoia Test Suite</a>
|
||||||
*/
|
*/
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testSubkeySignsAndIsHardRevokedUnknown() throws IOException, PGPException {
|
public void testSubkeySignsAndIsHardRevokedUnknown() throws IOException, PGPException {
|
||||||
|
|
||||||
String keyWithHardRev = "-----BEGIN PGP ARMORED FILE-----\n" +
|
String keyWithHardRev = "-----BEGIN PGP ARMORED FILE-----\n" +
|
||||||
|
@ -493,7 +493,7 @@ public class CertificateValidatorTest {
|
||||||
* @see <a href="https://tests.sequoia-pgp.org/#Key_revocation_test__primary_key_signs_and_is_revoked__revoked__superseded">Sequoia Test Suite</a>
|
* @see <a href="https://tests.sequoia-pgp.org/#Key_revocation_test__primary_key_signs_and_is_revoked__revoked__superseded">Sequoia Test Suite</a>
|
||||||
*/
|
*/
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testPrimaryKeySignsAndIsSoftRevokedSuperseded() throws IOException, PGPException {
|
public void testPrimaryKeySignsAndIsSoftRevokedSuperseded() throws IOException, PGPException {
|
||||||
|
|
||||||
String keyWithSoftRev = "-----BEGIN PGP ARMORED FILE-----\n" +
|
String keyWithSoftRev = "-----BEGIN PGP ARMORED FILE-----\n" +
|
||||||
|
@ -650,7 +650,7 @@ public class CertificateValidatorTest {
|
||||||
* @see <a href="https://tests.sequoia-pgp.org/#Key_revocation_test__subkey_signs__primary_key_is_revoked__revoked__superseded">Sequoia Test Suite</a>
|
* @see <a href="https://tests.sequoia-pgp.org/#Key_revocation_test__subkey_signs__primary_key_is_revoked__revoked__superseded">Sequoia Test Suite</a>
|
||||||
*/
|
*/
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testSubkeySignsPrimaryKeyIsSoftRevokedSuperseded() throws IOException, PGPException {
|
public void testSubkeySignsPrimaryKeyIsSoftRevokedSuperseded() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP ARMORED FILE-----\n" +
|
String key = "-----BEGIN PGP ARMORED FILE-----\n" +
|
||||||
|
@ -803,7 +803,7 @@ public class CertificateValidatorTest {
|
||||||
* @see <a href="https://tests.sequoia-pgp.org/#Key_revocation_test__primary_key_signs_and_is_revoked__revoked__key_retired">Sequoia Test Suite</a>
|
* @see <a href="https://tests.sequoia-pgp.org/#Key_revocation_test__primary_key_signs_and_is_revoked__revoked__key_retired">Sequoia Test Suite</a>
|
||||||
*/
|
*/
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testPrimaryKeySignsAndIsSoftRevokedRetired() throws IOException, PGPException {
|
public void testPrimaryKeySignsAndIsSoftRevokedRetired() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP ARMORED FILE-----\n" +
|
String key = "-----BEGIN PGP ARMORED FILE-----\n" +
|
||||||
|
@ -956,7 +956,7 @@ public class CertificateValidatorTest {
|
||||||
* @see <a href="https://tests.sequoia-pgp.org/#Temporary_validity">Sequoia Test Suite</a>
|
* @see <a href="https://tests.sequoia-pgp.org/#Temporary_validity">Sequoia Test Suite</a>
|
||||||
*/
|
*/
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testTemporaryValidity() throws IOException, PGPException {
|
public void testTemporaryValidity() throws IOException, PGPException {
|
||||||
|
|
||||||
String keyA = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
String keyA = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||||
|
|
|
@ -19,14 +19,14 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.pgpainless.PGPainless;
|
import org.pgpainless.PGPainless;
|
||||||
import org.pgpainless.exception.SignatureValidationException;
|
import org.pgpainless.exception.SignatureValidationException;
|
||||||
import org.pgpainless.signature.consumer.CertificateValidator;
|
import org.pgpainless.signature.consumer.CertificateValidator;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class KeyRevocationTest {
|
public class KeyRevocationTest {
|
||||||
|
|
||||||
private static final String data = "Hello, World";
|
private static final String data = "Hello, World";
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeySignsPrimaryKeyRevokedNoReason() throws IOException, PGPException {
|
public void subkeySignsPrimaryKeyRevokedNoReason() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP ARMORED FILE-----\n" +
|
String key = "-----BEGIN PGP ARMORED FILE-----\n" +
|
||||||
|
@ -173,7 +173,7 @@ public class KeyRevocationTest {
|
||||||
* @see <a href="https://tests.sequoia-pgp.org/#Key_revocation_test__subkey_signs__primary_key_is_not_revoked__base_case_">Sequoia Test-Suite</a>
|
* @see <a href="https://tests.sequoia-pgp.org/#Key_revocation_test__subkey_signs__primary_key_is_not_revoked__base_case_">Sequoia Test-Suite</a>
|
||||||
*/
|
*/
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void subkeySignsPrimaryKeyNotRevoked() throws IOException, PGPException {
|
public void subkeySignsPrimaryKeyNotRevoked() throws IOException, PGPException {
|
||||||
|
|
||||||
String key = "-----BEGIN PGP ARMORED FILE-----\n" +
|
String key = "-----BEGIN PGP ARMORED FILE-----\n" +
|
||||||
|
|
|
@ -47,12 +47,12 @@ import org.pgpainless.encryption_signing.SigningOptions;
|
||||||
import org.pgpainless.implementation.ImplementationFactory;
|
import org.pgpainless.implementation.ImplementationFactory;
|
||||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
|
|
||||||
public class OnePassSignatureBracketingTest {
|
public class OnePassSignatureBracketingTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void onePassSignaturePacketsAndSignaturesAreBracketedTest()
|
public void onePassSignaturePacketsAndSignaturesAreBracketedTest()
|
||||||
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IOException {
|
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IOException {
|
||||||
|
|
||||||
|
|
|
@ -19,13 +19,13 @@ import org.pgpainless.decryption_verification.DecryptionStream;
|
||||||
import org.pgpainless.encryption_signing.EncryptionOptions;
|
import org.pgpainless.encryption_signing.EncryptionOptions;
|
||||||
import org.pgpainless.encryption_signing.EncryptionStream;
|
import org.pgpainless.encryption_signing.EncryptionStream;
|
||||||
import org.pgpainless.encryption_signing.ProducerOptions;
|
import org.pgpainless.encryption_signing.ProducerOptions;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
import org.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
public class MultiPassphraseSymmetricEncryptionTest {
|
public class MultiPassphraseSymmetricEncryptionTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void encryptDecryptWithMultiplePassphrases() throws IOException, PGPException {
|
public void encryptDecryptWithMultiplePassphrases() throws IOException, PGPException {
|
||||||
String message = "Here we test if during decryption of a message that was encrypted with two passphrases, " +
|
String message = "Here we test if during decryption of a message that was encrypted with two passphrases, " +
|
||||||
"the decryptor finds the session key encrypted for the right passphrase.";
|
"the decryptor finds the session key encrypted for the right passphrase.";
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
||||||
import org.bouncycastle.util.io.Streams;
|
import org.bouncycastle.util.io.Streams;
|
||||||
import org.junit.jupiter.api.TestTemplate;
|
import org.junit.jupiter.api.TestTemplate;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
import org.pgpainless.util.TestAllImplementations;
|
||||||
import org.pgpainless.PGPainless;
|
import org.pgpainless.PGPainless;
|
||||||
import org.pgpainless.decryption_verification.ConsumerOptions;
|
import org.pgpainless.decryption_verification.ConsumerOptions;
|
||||||
import org.pgpainless.decryption_verification.DecryptionStream;
|
import org.pgpainless.decryption_verification.DecryptionStream;
|
||||||
|
@ -41,7 +41,7 @@ import org.pgpainless.util.Passphrase;
|
||||||
public class SymmetricEncryptionTest {
|
public class SymmetricEncryptionTest {
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void encryptWithKeyAndPassphrase_DecryptWithKey() throws IOException, PGPException {
|
public void encryptWithKeyAndPassphrase_DecryptWithKey() throws IOException, PGPException {
|
||||||
byte[] plaintext = "This is a secret message".getBytes(StandardCharsets.UTF_8);
|
byte[] plaintext = "This is a secret message".getBytes(StandardCharsets.UTF_8);
|
||||||
ByteArrayInputStream plaintextIn = new ByteArrayInputStream(plaintext);
|
ByteArrayInputStream plaintextIn = new ByteArrayInputStream(plaintext);
|
||||||
|
@ -94,7 +94,7 @@ public class SymmetricEncryptionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void testMismatchPassphraseFails() throws IOException, PGPException {
|
public void testMismatchPassphraseFails() throws IOException, PGPException {
|
||||||
byte[] bytes = new byte[5000];
|
byte[] bytes = new byte[5000];
|
||||||
new Random().nextBytes(bytes);
|
new Random().nextBytes(bytes);
|
||||||
|
|
|
@ -145,7 +145,7 @@ public class ArmorUtilsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
@ExtendWith(TestAllImplementations.class)
|
||||||
public void decodeExampleTest() throws IOException, PGPException {
|
public void decodeExampleTest() throws IOException, PGPException {
|
||||||
String armored = "-----BEGIN PGP MESSAGE-----\n" +
|
String armored = "-----BEGIN PGP MESSAGE-----\n" +
|
||||||
"Version: OpenPrivacy 0.99\n" +
|
"Version: OpenPrivacy 0.99\n" +
|
||||||
|
|
|
@ -33,7 +33,7 @@ import org.pgpainless.implementation.JceImplementationFactory;
|
||||||
*
|
*
|
||||||
* @see <a href="https://www.baeldung.com/junit5-test-templates">Baeldung: Writing Templates for Test Cases Using JUnit 5</a>
|
* @see <a href="https://www.baeldung.com/junit5-test-templates">Baeldung: Writing Templates for Test Cases Using JUnit 5</a>
|
||||||
*/
|
*/
|
||||||
public class ImplementationFactoryTestInvocationContextProvider implements TestTemplateInvocationContextProvider {
|
public class TestAllImplementations implements TestTemplateInvocationContextProvider {
|
||||||
|
|
||||||
private static final List<ImplementationFactory> IMPLEMENTATIONS = Arrays.asList(
|
private static final List<ImplementationFactory> IMPLEMENTATIONS = Arrays.asList(
|
||||||
new BcImplementationFactory(),
|
new BcImplementationFactory(),
|
|
@ -18,7 +18,7 @@ import java.util.stream.Stream;
|
||||||
/**
|
/**
|
||||||
* Utility class used to provide all available implementations of {@link ImplementationFactory} for parametrized tests.
|
* Utility class used to provide all available implementations of {@link ImplementationFactory} for parametrized tests.
|
||||||
*
|
*
|
||||||
* @deprecated in favor of {@link ImplementationFactoryTestInvocationContextProvider}.
|
* @deprecated in favor of {@link TestAllImplementations}.
|
||||||
*/
|
*/
|
||||||
public class TestImplementationFactoryProvider implements ArgumentsProvider {
|
public class TestImplementationFactoryProvider implements ArgumentsProvider {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue