mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-26 14:22:05 +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.extension.ExtendWith;
|
||||
import org.pgpainless.implementation.ImplementationFactory;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.PGPUtilWrapper;
|
||||
|
||||
public class PGPUtilWrapperTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testGetDecoderStream() throws IOException {
|
||||
|
||||
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.TestKeys;
|
||||
import org.pgpainless.key.util.KeyRingUtils;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class DecryptAndVerifyMessageTest {
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class DecryptAndVerifyMessageTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void decryptMessageAndVerifySignatureTest() throws Exception {
|
||||
String encryptedMessage = TestKeys.MSG_SIGN_CRYPT_JULIET_JULIET;
|
||||
|
||||
|
|
|
@ -22,12 +22,12 @@ import org.pgpainless.PGPainless;
|
|||
import org.pgpainless.algorithm.EncryptionPurpose;
|
||||
import org.pgpainless.key.SubkeyIdentifier;
|
||||
import org.pgpainless.key.info.KeyRingInfo;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class DecryptHiddenRecipientMessage {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testDecryptionWithWildcardRecipient() throws IOException, PGPException {
|
||||
String secretKeyAscii = "-----BEGIN PGP PRIVATE KEY BLOCK-----\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.ModificationDetectionException;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
|
||||
public class ModificationDetectionTests {
|
||||
|
@ -208,7 +208,7 @@ public class ModificationDetectionTests {
|
|||
* @throws PGPException in case of a pgp error
|
||||
*/
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testMissingMDCThrowsByDefault() throws IOException, PGPException {
|
||||
|
||||
PGPSecretKeyRingCollection secretKeyRings = getDecryptionKey();
|
||||
|
@ -228,7 +228,7 @@ public class ModificationDetectionTests {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testTamperedCiphertextThrows() throws IOException, PGPException {
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_TAMPERED_CIPHERTEXT.getBytes(StandardCharsets.UTF_8));
|
||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||
|
@ -243,7 +243,7 @@ public class ModificationDetectionTests {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testIgnoreTamperedCiphertext() throws IOException, PGPException {
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_TAMPERED_CIPHERTEXT.getBytes(StandardCharsets.UTF_8));
|
||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||
|
@ -259,7 +259,7 @@ public class ModificationDetectionTests {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testTamperedMDCThrowsByDefault() throws IOException, PGPException {
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_TAMPERED_MDC.getBytes(StandardCharsets.UTF_8));
|
||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||
|
@ -274,7 +274,7 @@ public class ModificationDetectionTests {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testIgnoreTamperedMDC() throws IOException, PGPException {
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_TAMPERED_MDC.getBytes(StandardCharsets.UTF_8));
|
||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||
|
@ -289,7 +289,7 @@ public class ModificationDetectionTests {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testTruncatedMDCThrows() throws IOException, PGPException {
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_TRUNCATED_MDC.getBytes(StandardCharsets.UTF_8));
|
||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||
|
@ -303,7 +303,7 @@ public class ModificationDetectionTests {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testMDCWithBadCTBThrows() throws IOException, PGPException {
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_MDC_WITH_BAD_CTB.getBytes(StandardCharsets.UTF_8));
|
||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||
|
@ -318,7 +318,7 @@ public class ModificationDetectionTests {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testIgnoreMDCWithBadCTB() throws IOException, PGPException {
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_MDC_WITH_BAD_CTB.getBytes(StandardCharsets.UTF_8));
|
||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||
|
@ -334,7 +334,7 @@ public class ModificationDetectionTests {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testMDCWithBadLengthThrows() throws IOException, PGPException {
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_MDC_WITH_BAD_LENGTH.getBytes(StandardCharsets.UTF_8));
|
||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||
|
@ -349,7 +349,7 @@ public class ModificationDetectionTests {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testIgnoreMDCWithBadLength() throws IOException, PGPException {
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(MESSAGE_MDC_WITH_BAD_LENGTH.getBytes(StandardCharsets.UTF_8));
|
||||
DecryptionStream decryptionStream = PGPainless.decryptAndOrVerify()
|
||||
|
@ -365,7 +365,7 @@ public class ModificationDetectionTests {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void decryptMessageWithSEDPacket() throws IOException {
|
||||
Passphrase passphrase = Passphrase.fromPassword("flowcrypt compatibility tests");
|
||||
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.extension.ExtendWith;
|
||||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
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>
|
||||
*/
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void decryptionAbortsWhenMaximumRecursionDepthReachedTest()
|
||||
throws IOException {
|
||||
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.policy.Policy;
|
||||
import org.pgpainless.util.ArmoredOutputStreamFactory;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class EncryptDecryptTest {
|
||||
|
||||
|
@ -70,7 +70,7 @@ public class EncryptDecryptTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void freshKeysRsaToElGamalTest()
|
||||
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
|
||||
PGPSecretKeyRing sender = PGPainless.generateKeyRing().simpleRsaKeyRing("romeo@montague.lit", RsaLength._3072);
|
||||
|
@ -87,7 +87,7 @@ public class EncryptDecryptTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void freshKeysRsaToRsaTest()
|
||||
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
|
||||
PGPSecretKeyRing sender = PGPainless.generateKeyRing().simpleRsaKeyRing("romeo@montague.lit", RsaLength._3072);
|
||||
|
@ -97,7 +97,7 @@ public class EncryptDecryptTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void freshKeysEcToEcTest()
|
||||
throws IOException, PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException {
|
||||
PGPSecretKeyRing sender = PGPainless.generateKeyRing().simpleEcKeyRing("romeo@montague.lit");
|
||||
|
@ -107,7 +107,7 @@ public class EncryptDecryptTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void freshKeysEcToRsaTest()
|
||||
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
|
||||
PGPSecretKeyRing sender = PGPainless.generateKeyRing().simpleEcKeyRing("romeo@montague.lit");
|
||||
|
@ -117,7 +117,7 @@ public class EncryptDecryptTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void freshKeysRsaToEcTest()
|
||||
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
|
||||
PGPSecretKeyRing sender = PGPainless.generateKeyRing().simpleRsaKeyRing("romeo@montague.lit", RsaLength._3072);
|
||||
|
@ -127,7 +127,7 @@ public class EncryptDecryptTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void existingRsaKeysTest() throws IOException, PGPException {
|
||||
PGPSecretKeyRing sender = TestKeys.getJulietSecretKeyRing();
|
||||
PGPSecretKeyRing recipient = TestKeys.getRomeoSecretKeyRing();
|
||||
|
@ -191,7 +191,7 @@ public class EncryptDecryptTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testDetachedSignatureCreationAndVerification() throws IOException, PGPException {
|
||||
|
||||
PGPSecretKeyRing signingKeys = TestKeys.getJulietSecretKeyRing();
|
||||
|
@ -236,7 +236,7 @@ public class EncryptDecryptTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testOnePassSignatureCreationAndVerification() throws IOException, PGPException {
|
||||
PGPSecretKeyRing signingKeys = TestKeys.getJulietSecretKeyRing();
|
||||
SecretKeyRingProtector keyRingProtector = new UnprotectedKeysProtector();
|
||||
|
@ -266,7 +266,7 @@ public class EncryptDecryptTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void expiredSubkeyBacksigTest() throws IOException {
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
"\n" +
|
||||
|
|
|
@ -14,13 +14,13 @@ import org.bouncycastle.openpgp.PGPException;
|
|||
import org.junit.jupiter.api.TestTemplate;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
|
||||
public class EncryptionStreamClosedTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testStreamHasToBeClosedBeforeGetResultCanBeCalled() throws IOException, PGPException {
|
||||
OutputStream out = new ByteArrayOutputStream();
|
||||
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.protection.SecretKeyRingProtector;
|
||||
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.Passphrase;
|
||||
|
||||
public class SigningTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testEncryptionAndSignatureVerification()
|
||||
throws IOException, PGPException {
|
||||
|
||||
|
@ -116,7 +116,7 @@ public class SigningTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testSignWithInvalidUserIdFails()
|
||||
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||
PGPSecretKeyRing secretKeys = PGPainless.generateKeyRing()
|
||||
|
@ -131,7 +131,7 @@ public class SigningTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testSignWithRevokedUserIdFails()
|
||||
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||
PGPSecretKeyRing secretKeys = PGPainless.generateKeyRing()
|
||||
|
@ -152,7 +152,7 @@ public class SigningTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void signWithHashAlgorithmOverride() throws PGPException, IOException {
|
||||
PGPSecretKeyRing secretKeys = TestKeys.getEmilSecretKeyRing();
|
||||
SecretKeyRingProtector protector = SecretKeyRingProtector.unprotectedKeys();
|
||||
|
@ -184,7 +184,7 @@ public class SigningTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void negotiateHashAlgorithmChoseFallbackIfEmptyPreferences()
|
||||
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IOException {
|
||||
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
||||
|
@ -214,7 +214,7 @@ public class SigningTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void negotiateHashAlgorithmChoseFallbackIfUnacceptablePreferences()
|
||||
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IOException {
|
||||
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
||||
|
@ -244,7 +244,7 @@ public class SigningTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void signingWithNonCapableKeyThrowsKeyCannotSignException()
|
||||
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
||||
|
@ -260,7 +260,7 @@ public class SigningTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void signWithInvalidUserIdThrowsKeyValidationError()
|
||||
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||
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.extension.ExtendWith;
|
||||
import org.pgpainless.provider.ProviderFactory;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class BouncycastleExportSubkeys {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testExportImport() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, PGPException {
|
||||
KeyPairGenerator generator;
|
||||
KeyPair pair;
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator;
|
|||
import org.junit.jupiter.api.TestTemplate;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.pgpainless.implementation.ImplementationFactory;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class ImportExportKeyTest {
|
||||
|
||||
|
@ -25,7 +25,7 @@ public class ImportExportKeyTest {
|
|||
* @throws IOException in case of a IO error
|
||||
*/
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testExportImportPublicKeyRing() throws IOException {
|
||||
PGPPublicKeyRing publicKeys = TestKeys.getJulietPublicKeyRing();
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class ImportExportKeyTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testExportImportSecretKeyRing() throws IOException, PGPException {
|
||||
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.util.UserId;
|
||||
import org.pgpainless.util.BCUtil;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
|
||||
public class BrainpoolKeyGenerationTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void generateEcKeysTest()
|
||||
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException {
|
||||
|
||||
|
@ -65,7 +65,7 @@ public class BrainpoolKeyGenerationTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void generateEdDSAKeyTest()
|
||||
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.ecc.EllipticCurve;
|
||||
import org.pgpainless.key.generation.type.xdh.XDHSpec;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class CertificationKeyMustBeAbleToCertifyTest {
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class CertificationKeyMustBeAbleToCertifyTest {
|
|||
* This test therefore verifies that generating such keys fails.
|
||||
*/
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testCertificationIncapableKeyTypesThrow() {
|
||||
KeyType[] typesIncapableOfCreatingVerifications = new KeyType[] {
|
||||
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.UnlockSecretKey;
|
||||
import org.pgpainless.key.util.UserId;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class GenerateEllipticCurveKeyTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void generateEllipticCurveKeys()
|
||||
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException {
|
||||
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.UserId;
|
||||
import org.pgpainless.util.DateUtil;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class GenerateKeyWithAdditionalUserIdTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void test() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, IOException {
|
||||
Date expiration = new Date(DateUtil.now().getTime() + 60 * 1000);
|
||||
PGPSecretKeyRing secretKeys = PGPainless.buildKeyRing()
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.pgpainless.PGPainless;
|
|||
import org.pgpainless.algorithm.KeyFlag;
|
||||
import org.pgpainless.key.generation.type.KeyType;
|
||||
import org.pgpainless.key.generation.type.rsa.RsaLength;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
|
||||
/**
|
||||
|
@ -29,7 +29,7 @@ import org.pgpainless.util.Passphrase;
|
|||
public class GenerateWithEmptyPassphraseTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testGeneratingKeyWithEmptyPassphraseDoesNotThrow()
|
||||
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.eddsa.EdDSACurve;
|
||||
import org.pgpainless.key.generation.type.xdh.XDHSpec;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class IllegalKeyFlagsTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testKeyCannotCarryFlagsTest() {
|
||||
assertThrows(IllegalArgumentException.class, () -> KeySpec.getBuilder(
|
||||
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.UserId;
|
||||
import org.pgpainless.util.DateUtil;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
|
||||
public class KeyRingInfoTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testWithEmilsKeys() throws IOException, PGPException {
|
||||
|
||||
PGPSecretKeyRing secretKeys = TestKeys.getEmilSecretKeyRing();
|
||||
|
@ -174,7 +174,7 @@ public class KeyRingInfoTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void dummyS2KTest() throws IOException {
|
||||
|
||||
String withDummyS2K = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n" +
|
||||
|
@ -212,7 +212,7 @@ public class KeyRingInfoTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testGetKeysWithFlagsAndExpiry() throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||
|
||||
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.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
|
||||
public class AddSubKeyTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testAddSubKey()
|
||||
throws IOException, PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||
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.UnprotectedKeysProtector;
|
||||
import org.pgpainless.key.util.UserId;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
|
||||
public class AddUserIdTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void addUserIdToExistingKeyRing()
|
||||
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException {
|
||||
PGPSecretKeyRing secretKeys = PGPainless.generateKeyRing().simpleEcKeyRing("alice@wonderland.lit", "rabb1th0le");
|
||||
|
@ -65,7 +65,7 @@ public class AddUserIdTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void deleteUserId_noSuchElementExceptionForMissingUserId() throws IOException, PGPException {
|
||||
|
||||
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
|
||||
|
@ -74,7 +74,7 @@ public class AddUserIdTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void deleteExistingAndAddNewUserIdToExistingKeyRing() throws PGPException, IOException {
|
||||
|
||||
final String ARMORED_PRIVATE_KEY =
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
|||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.util.DateUtil;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class ChangeExpirationOnKeyWithDifferentSignatureTypesTest {
|
||||
|
||||
|
@ -136,7 +136,7 @@ public class ChangeExpirationOnKeyWithDifferentSignatureTypesTest {
|
|||
"-----END PGP PRIVATE KEY BLOCK-----";
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void setExpirationDate_keyHasSigClass10()
|
||||
throws PGPException, IOException {
|
||||
PGPSecretKeyRing keys = PGPainless.readKeyRing().secretKeyRing(keyWithGenericCertification);
|
||||
|
@ -145,7 +145,7 @@ public class ChangeExpirationOnKeyWithDifferentSignatureTypesTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void setExpirationDate_keyHasSigClass12()
|
||||
throws PGPException, IOException {
|
||||
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.protection.UnprotectedKeysProtector;
|
||||
import org.pgpainless.util.DateUtil;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class ChangeExpirationTest {
|
||||
|
||||
private final OpenPgpV4Fingerprint subKeyFingerprint = new OpenPgpV4Fingerprint("F73FDE6439ABE210B1AF4EDD273EF7A0C749807B");
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void setExpirationDateAndThenUnsetIt_OnPrimaryKey()
|
||||
throws PGPException, IOException, InterruptedException {
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class ChangeExpirationTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void setExpirationDateAndThenUnsetIt_OnSubkey()
|
||||
throws PGPException, IOException, InterruptedException {
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.pgpainless.implementation.ImplementationFactory;
|
|||
import org.pgpainless.key.protection.KeyRingProtectionSettings;
|
||||
import org.pgpainless.key.protection.PasswordBasedSecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
|
||||
public class ChangeSecretKeyRingPassphraseTest {
|
||||
|
@ -43,7 +43,7 @@ public class ChangeSecretKeyRingPassphraseTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void changePassphraseOfWholeKeyRingTest() throws PGPException {
|
||||
|
||||
PGPSecretKeyRing secretKeys = PGPainless.modifyKeyRing(keyRing)
|
||||
|
@ -70,7 +70,7 @@ public class ChangeSecretKeyRingPassphraseTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void changePassphraseOfWholeKeyRingToEmptyPassphrase() throws PGPException, IOException {
|
||||
PGPSecretKeyRing secretKeys = PGPainless.modifyKeyRing(keyRing)
|
||||
.changePassphraseFromOldPassphrase(Passphrase.fromPassword("weakPassphrase"))
|
||||
|
@ -87,7 +87,7 @@ public class ChangeSecretKeyRingPassphraseTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void changePassphraseOfSingleSubkeyToNewPassphrase() throws PGPException {
|
||||
|
||||
Iterator<PGPSecretKey> keys = keyRing.getSecretKeys();
|
||||
|
@ -123,7 +123,7 @@ public class ChangeSecretKeyRingPassphraseTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void changePassphraseOfSingleSubkeyToEmptyPassphrase() throws PGPException {
|
||||
|
||||
Iterator<PGPSecretKey> keys = keyRing.getSecretKeys();
|
||||
|
|
|
@ -21,12 +21,12 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
|||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.key.OpenPgpV4Fingerprint;
|
||||
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class OldSignatureSubpacketsArePreservedOnNewSig {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void verifyOldSignatureSubpacketsArePreservedOnNewExpirationDateSig()
|
||||
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, InterruptedException {
|
||||
PGPSecretKeyRing secretKeys = PGPainless.generateKeyRing()
|
||||
|
|
|
@ -19,7 +19,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
|||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||
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
|
||||
|
@ -64,7 +64,7 @@ public class RevokeKeyWithGenericCertificationSignatureTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void test() throws IOException, PGPException {
|
||||
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.UnprotectedKeysProtector;
|
||||
import org.pgpainless.util.DateUtil;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class RevokeKeyWithoutPreferredAlgorithmsOnPrimaryKey {
|
||||
|
||||
|
@ -101,7 +101,7 @@ public class RevokeKeyWithoutPreferredAlgorithmsOnPrimaryKey {
|
|||
"-----END PGP PRIVATE KEY BLOCK-----";
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testChangingExpirationTimeWithKeyWithoutPrefAlgos()
|
||||
throws IOException, PGPException {
|
||||
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.subpackets.RevocationSignatureSubpackets;
|
||||
import org.pgpainless.signature.subpackets.SignatureSubpacketsUtil;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
|
||||
public class RevokeSubKeyTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void revokeSukeyTest() throws IOException, PGPException {
|
||||
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
|
||||
|
||||
|
@ -68,7 +68,7 @@ public class RevokeSubKeyTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void detachedRevokeSubkeyTest() throws IOException, PGPException {
|
||||
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
|
||||
OpenPgpV4Fingerprint fingerprint = new OpenPgpV4Fingerprint(secretKeys);
|
||||
|
@ -88,7 +88,7 @@ public class RevokeSubKeyTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testRevocationSignatureTypeCorrect() throws IOException, PGPException {
|
||||
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
|
||||
Iterator<PGPPublicKey> keysIterator = secretKeys.getPublicKeys();
|
||||
|
|
|
@ -28,13 +28,13 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
|||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.key.TestKeys;
|
||||
import org.pgpainless.key.protection.passphrase_provider.SecretKeyPassphraseProvider;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
|
||||
public class SecretKeyRingProtectorTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testUnlockAllKeysWithSamePassword()
|
||||
throws IOException, PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||
|
||||
|
@ -68,7 +68,7 @@ public class SecretKeyRingProtectorTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testUnlockSingleKeyWithPassphrase()
|
||||
throws IOException, PGPException {
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.pgpainless.PGPainless;
|
|||
import org.pgpainless.exception.SignatureValidationException;
|
||||
import org.pgpainless.policy.Policy;
|
||||
import org.pgpainless.signature.consumer.CertificateValidator;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
/**
|
||||
* Explores how subpackets on binding sigs are handled.
|
||||
|
@ -52,7 +52,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
private Policy policy = PGPainless.getPolicy();
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void baseCase() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -113,7 +113,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeyBindingIssuerFpOnly() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -174,7 +174,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeyBindingIssuerV6IssuerFp() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -235,7 +235,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeyBindingIssuerFakeIssuer() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -296,7 +296,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeyBindingFakeIssuerIssuer() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -357,7 +357,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeyBindingFakeIssuer() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -418,7 +418,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeyBindingNoIssuer() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -478,7 +478,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void unknownSubpacketHashed() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -539,7 +539,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeyBindingUnknownCriticalSubpacket() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -600,7 +600,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeyBindingUnknownSubpacketUnhashed() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -661,7 +661,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeyBindingUnknownCriticalSubpacketUnhashed() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -722,7 +722,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeyBindingUnknownNotationHashed() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -784,7 +784,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeyBindingCriticalUnknownNotationHashed() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -846,7 +846,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeyBindingUnknownNotationUnhashed() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -908,7 +908,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeyBindingCriticalUnknownNotationUnhashed() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -970,7 +970,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeyBindingBackSigFakeBackSig() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -1042,7 +1042,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeyBindingFakeBackSigBackSig() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -1114,7 +1114,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void primaryBindingIssuerFpOnly() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -1175,7 +1175,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void primaryBindingIssuerV6IssuerFp() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -1236,7 +1236,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void primaryBindingIssuerFakeIssuer() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -1297,7 +1297,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void primaryBindingFakeIssuerIssuer() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -1358,7 +1358,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void primaryBindingFakeIssuer() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -1419,7 +1419,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void primaryBindingNoIssuer() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -1479,7 +1479,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void primaryBindingUnknownSubpacketHashed() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -1540,7 +1540,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void primaryBindingCriticalUnknownSubpacketHashed() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -1601,7 +1601,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void primaryBindingUnknownSubpacketUnhashed() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -1662,7 +1662,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void primaryBindingCriticalUnknownSubpacketUnhashed() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -1723,7 +1723,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void primaryBindingUnknownNotationHashed() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -1785,7 +1785,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void primaryBindingCriticalUnknownNotationHashed() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -1847,7 +1847,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void primaryBindingUnknownNotationUnhashed() throws IOException, PGPException {
|
||||
|
||||
String key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
|
||||
|
@ -1909,7 +1909,7 @@ public class BindingSignatureSubpacketsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void primaryBindingCriticalUnknownNotationUnhashed() throws IOException, PGPException {
|
||||
|
||||
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.policy.Policy;
|
||||
import org.pgpainless.signature.consumer.CertificateValidator;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
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>
|
||||
*/
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testPrimaryKeySignsAndIsHardRevokedUnknown() throws IOException, PGPException {
|
||||
|
||||
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>
|
||||
*/
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testSubkeySignsPrimaryKeyIsHardRevokedUnknown() throws IOException, PGPException {
|
||||
|
||||
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>
|
||||
*/
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testSubkeySignsAndIsHardRevokedUnknown() throws IOException, PGPException {
|
||||
|
||||
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>
|
||||
*/
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testPrimaryKeySignsAndIsSoftRevokedSuperseded() throws IOException, PGPException {
|
||||
|
||||
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>
|
||||
*/
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testSubkeySignsPrimaryKeyIsSoftRevokedSuperseded() throws IOException, PGPException {
|
||||
|
||||
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>
|
||||
*/
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testPrimaryKeySignsAndIsSoftRevokedRetired() throws IOException, PGPException {
|
||||
|
||||
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>
|
||||
*/
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testTemporaryValidity() throws IOException, PGPException {
|
||||
|
||||
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.exception.SignatureValidationException;
|
||||
import org.pgpainless.signature.consumer.CertificateValidator;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class KeyRevocationTest {
|
||||
|
||||
private static final String data = "Hello, World";
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeySignsPrimaryKeyRevokedNoReason() throws IOException, PGPException {
|
||||
|
||||
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>
|
||||
*/
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void subkeySignsPrimaryKeyNotRevoked() throws IOException, PGPException {
|
||||
|
||||
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.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class OnePassSignatureBracketingTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void onePassSignaturePacketsAndSignaturesAreBracketedTest()
|
||||
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.EncryptionStream;
|
||||
import org.pgpainless.encryption_signing.ProducerOptions;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
|
||||
public class MultiPassphraseSymmetricEncryptionTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void encryptDecryptWithMultiplePassphrases() throws IOException, PGPException {
|
||||
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.";
|
||||
|
|
|
@ -19,7 +19,7 @@ import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
|||
import org.bouncycastle.util.io.Streams;
|
||||
import org.junit.jupiter.api.TestTemplate;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.pgpainless.util.ImplementationFactoryTestInvocationContextProvider;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.decryption_verification.ConsumerOptions;
|
||||
import org.pgpainless.decryption_verification.DecryptionStream;
|
||||
|
@ -41,7 +41,7 @@ import org.pgpainless.util.Passphrase;
|
|||
public class SymmetricEncryptionTest {
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void encryptWithKeyAndPassphrase_DecryptWithKey() throws IOException, PGPException {
|
||||
byte[] plaintext = "This is a secret message".getBytes(StandardCharsets.UTF_8);
|
||||
ByteArrayInputStream plaintextIn = new ByteArrayInputStream(plaintext);
|
||||
|
@ -94,7 +94,7 @@ public class SymmetricEncryptionTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void testMismatchPassphraseFails() throws IOException, PGPException {
|
||||
byte[] bytes = new byte[5000];
|
||||
new Random().nextBytes(bytes);
|
||||
|
|
|
@ -145,7 +145,7 @@ public class ArmorUtilsTest {
|
|||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(ImplementationFactoryTestInvocationContextProvider.class)
|
||||
@ExtendWith(TestAllImplementations.class)
|
||||
public void decodeExampleTest() throws IOException, PGPException {
|
||||
String armored = "-----BEGIN PGP MESSAGE-----\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>
|
||||
*/
|
||||
public class ImplementationFactoryTestInvocationContextProvider implements TestTemplateInvocationContextProvider {
|
||||
public class TestAllImplementations implements TestTemplateInvocationContextProvider {
|
||||
|
||||
private static final List<ImplementationFactory> IMPLEMENTATIONS = Arrays.asList(
|
||||
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.
|
||||
*
|
||||
* @deprecated in favor of {@link ImplementationFactoryTestInvocationContextProvider}.
|
||||
* @deprecated in favor of {@link TestAllImplementations}.
|
||||
*/
|
||||
public class TestImplementationFactoryProvider implements ArgumentsProvider {
|
||||
|
||||
|
|
Loading…
Reference in a new issue