mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-16 01:12:05 +01:00
Reorganize classes in packages
Move ArmorUtils to org.pgpainless.ascii_armor Move Armored*StreamFactory to org.pgpainless.ascii_armor Move CRCingArmoredInputStreamWrapper to org.pgpainless.ascii_armor Move SessionKey to org.pgpainless.s2k Move RevocationAttributes to org.pgpainless.key Move UserId to org.pgpainless.key Move Passphrase to org.pgpainless.s2k Move NotationRegistry to org.pgpainless.policy
This commit is contained in:
parent
bed18dc0ad
commit
68575f9f1e
111 changed files with 162 additions and 126 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -8,6 +8,16 @@ SPDX-License-Identifier: CC0-1.0
|
|||
## 1.3.7-SNAPSHOT
|
||||
- Add `KeyRingUtils.injectCertification(keys, certification)`
|
||||
- Bugfix: Fix signature verification when `DecryptionStream` is drained byte-by-byte using `read()` call
|
||||
- Refactoring:
|
||||
- Move `ArmorUtils` to `org.pgpainless.ascii_armor` package
|
||||
- Move `ArmoredInputStreamFactory` to `org.pgpainless.ascii_armor` package
|
||||
- Move `ArmoredOutputStreamFactory` to `org.pgpainless.ascii_armor` package
|
||||
- Move `CRCingArmoredInputStreamWrwapper` to `org.pgpainless.ascii_armor` package
|
||||
- Move `SessionKey` to `org.pgpainless.s2k` package
|
||||
- Move `RevocationAttributes` to `org.pgpainless.key` package
|
||||
- Move `UserId` to `org.pgpainless.key` package
|
||||
- Move `Passphrase` to `org.pgpainless.s2k` package
|
||||
- Move `NotationRegistry` to `org.pgpainless.policy` package
|
||||
|
||||
## 1.3.6
|
||||
- Remove deprecated methods
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.pgpainless.cli.TestUtils;
|
|||
import org.pgpainless.key.info.KeyInfo;
|
||||
import org.pgpainless.key.info.KeyRingInfo;
|
||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class GenerateCertCmdTest {
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.pgpainless.key.modification.secretkeyring.SecretKeyRingEditorInterfac
|
|||
import org.pgpainless.key.parsing.KeyRingReader;
|
||||
import org.pgpainless.key.util.KeyRingUtils;
|
||||
import org.pgpainless.policy.Policy;
|
||||
import org.pgpainless.util.ArmorUtils;
|
||||
import org.pgpainless.ascii_armor.ArmorUtils;
|
||||
|
||||
public final class PGPainless {
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.util;
|
||||
package org.pgpainless.ascii_armor;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
@ -32,6 +32,8 @@ import org.bouncycastle.util.io.Streams;
|
|||
import org.pgpainless.algorithm.HashAlgorithm;
|
||||
import org.pgpainless.decryption_verification.OpenPgpInputStream;
|
||||
import org.pgpainless.key.OpenPgpFingerprint;
|
||||
import org.pgpainless.util.MultiMap;
|
||||
import org.pgpainless.util.Tuple;
|
||||
|
||||
public final class ArmorUtils {
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.util;
|
||||
package org.pgpainless.ascii_armor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.util;
|
||||
package org.pgpainless.ascii_armor;
|
||||
|
||||
import java.io.OutputStream;
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.util;
|
||||
package org.pgpainless.ascii_armor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
|
@ -0,0 +1,8 @@
|
|||
// SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/**
|
||||
* Classes related to ASCII armoring.
|
||||
*/
|
||||
package org.pgpainless.ascii_armor;
|
|
@ -25,9 +25,9 @@ import org.bouncycastle.openpgp.PGPSignature;
|
|||
import org.pgpainless.decryption_verification.cleartext_signatures.InMemoryMultiPassStrategy;
|
||||
import org.pgpainless.decryption_verification.cleartext_signatures.MultiPassStrategy;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.s2k.SessionKey;
|
||||
import org.pgpainless.signature.SignatureUtils;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.util.SessionKey;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
/**
|
||||
* Options for decryption and signature verification.
|
||||
|
|
|
@ -60,12 +60,12 @@ import org.pgpainless.key.SubkeyIdentifier;
|
|||
import org.pgpainless.key.info.KeyRingInfo;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||
import org.pgpainless.s2k.SessionKey;
|
||||
import org.pgpainless.signature.SignatureUtils;
|
||||
import org.pgpainless.signature.consumer.DetachedSignatureCheck;
|
||||
import org.pgpainless.signature.consumer.OnePassSignatureCheck;
|
||||
import org.pgpainless.util.ArmoredInputStreamFactory;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.util.SessionKey;
|
||||
import org.pgpainless.ascii_armor.ArmoredInputStreamFactory;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
import org.pgpainless.util.Tuple;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.bouncycastle.openpgp.PGPPBEEncryptedData;
|
|||
import org.bouncycastle.openpgp.PGPPublicKeyEncryptedData;
|
||||
import org.bouncycastle.openpgp.PGPUtil;
|
||||
import org.pgpainless.implementation.ImplementationFactory;
|
||||
import org.pgpainless.util.ArmorUtils;
|
||||
import org.pgpainless.ascii_armor.ArmorUtils;
|
||||
|
||||
/**
|
||||
* Inspect an OpenPGP message to determine IDs of its encryption keys or whether it is passphrase protected.
|
||||
|
|
|
@ -25,7 +25,8 @@ import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
|||
import org.pgpainless.exception.SignatureValidationException;
|
||||
import org.pgpainless.key.OpenPgpFingerprint;
|
||||
import org.pgpainless.key.SubkeyIdentifier;
|
||||
import org.pgpainless.util.SessionKey;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
import org.pgpainless.s2k.SessionKey;
|
||||
|
||||
public class OpenPgpMetadata {
|
||||
|
||||
|
@ -89,7 +90,7 @@ public class OpenPgpMetadata {
|
|||
|
||||
/**
|
||||
* Return the {@link SubkeyIdentifier} of the key that was used to decrypt the message.
|
||||
* This can be null if the message was decrypted using a {@link org.pgpainless.util.Passphrase}, or if it was not
|
||||
* This can be null if the message was decrypted using a {@link Passphrase}, or if it was not
|
||||
* encrypted at all (e.g. signed only).
|
||||
*
|
||||
* @return subkey identifier of decryption key
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.bouncycastle.openpgp.PGPSignatureList;
|
|||
import org.bouncycastle.util.Strings;
|
||||
import org.pgpainless.exception.WrongConsumingMethodException;
|
||||
import org.pgpainless.implementation.ImplementationFactory;
|
||||
import org.pgpainless.util.ArmoredInputStreamFactory;
|
||||
import org.pgpainless.ascii_armor.ArmoredInputStreamFactory;
|
||||
|
||||
/**
|
||||
* Utility class to deal with cleartext-signed messages.
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.pgpainless.key.OpenPgpFingerprint;
|
|||
import org.pgpainless.key.SubkeyIdentifier;
|
||||
import org.pgpainless.key.info.KeyAccessor;
|
||||
import org.pgpainless.key.info.KeyRingInfo;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
/**
|
||||
* Options for the encryption process.
|
||||
|
|
|
@ -26,8 +26,8 @@ import org.pgpainless.algorithm.StreamEncoding;
|
|||
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||
import org.pgpainless.implementation.ImplementationFactory;
|
||||
import org.pgpainless.key.SubkeyIdentifier;
|
||||
import org.pgpainless.util.ArmorUtils;
|
||||
import org.pgpainless.util.ArmoredOutputStreamFactory;
|
||||
import org.pgpainless.ascii_armor.ArmorUtils;
|
||||
import org.pgpainless.ascii_armor.ArmoredOutputStreamFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.bouncycastle.openpgp.PGPLiteralData;
|
|||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.algorithm.CompressionAlgorithm;
|
||||
import org.pgpainless.algorithm.StreamEncoding;
|
||||
import org.pgpainless.ascii_armor.ArmoredOutputStreamFactory;
|
||||
|
||||
public final class ProducerOptions {
|
||||
|
||||
|
@ -120,7 +121,7 @@ public final class ProducerOptions {
|
|||
* The default value is null, which means no comment header is added.
|
||||
* Multiline comments are possible using '\\n'.
|
||||
*
|
||||
* Note: If a default header comment is set using {@link org.pgpainless.util.ArmoredOutputStreamFactory#setComment(String)},
|
||||
* Note: If a default header comment is set using {@link ArmoredOutputStreamFactory#setComment(String)},
|
||||
* then both comments will be written to the produced ASCII armor.
|
||||
*
|
||||
* @param comment comment header text
|
||||
|
|
|
@ -48,7 +48,7 @@ import org.bouncycastle.openpgp.operator.jcajce.JcaPGPKeyPair;
|
|||
import org.pgpainless.algorithm.HashAlgorithm;
|
||||
import org.pgpainless.algorithm.PublicKeyAlgorithm;
|
||||
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class BcImplementationFactory extends ImplementationFactory {
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.bouncycastle.openpgp.operator.SessionKeyDataDecryptorFactory;
|
|||
import org.pgpainless.algorithm.HashAlgorithm;
|
||||
import org.pgpainless.algorithm.PublicKeyAlgorithm;
|
||||
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public abstract class ImplementationFactory {
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ import org.pgpainless.algorithm.HashAlgorithm;
|
|||
import org.pgpainless.algorithm.PublicKeyAlgorithm;
|
||||
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||
import org.pgpainless.provider.ProviderFactory;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class JceImplementationFactory extends ImplementationFactory {
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.key.util;
|
||||
package org.pgpainless.key;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Map;
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.key.util;
|
||||
package org.pgpainless.key;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
|
@ -21,7 +21,7 @@ import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
|
|||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
||||
import org.pgpainless.implementation.ImplementationFactory;
|
||||
import org.pgpainless.util.ArmorUtils;
|
||||
import org.pgpainless.ascii_armor.ArmorUtils;
|
||||
|
||||
/**
|
||||
* This class describes a logic of handling a collection of different {@link PGPKeyRing}. The logic was inspired by
|
||||
|
|
|
@ -50,7 +50,7 @@ import org.pgpainless.provider.ProviderFactory;
|
|||
import org.pgpainless.signature.subpackets.SelfSignatureSubpackets;
|
||||
import org.pgpainless.signature.subpackets.SignatureSubpackets;
|
||||
import org.pgpainless.signature.subpackets.SignatureSubpacketsHelper;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class KeyRingBuilder implements KeyRingBuilderInterface<KeyRingBuilder> {
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ import javax.annotation.Nonnull;
|
|||
|
||||
import org.bouncycastle.openpgp.PGPException;
|
||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||
import org.pgpainless.key.util.UserId;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.key.UserId;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public interface KeyRingBuilderInterface<B extends KeyRingBuilderInterface<B>> {
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ import org.pgpainless.key.generation.type.KeyType;
|
|||
import org.pgpainless.key.generation.type.eddsa.EdDSACurve;
|
||||
import org.pgpainless.key.generation.type.rsa.RsaLength;
|
||||
import org.pgpainless.key.generation.type.xdh.XDHSpec;
|
||||
import org.pgpainless.key.util.UserId;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.key.UserId;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public final class KeyRingTemplates {
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
|||
import org.pgpainless.exception.KeyException;
|
||||
import org.pgpainless.key.OpenPgpFingerprint;
|
||||
import org.pgpainless.key.SubkeyIdentifier;
|
||||
import org.pgpainless.key.util.RevocationAttributes;
|
||||
import org.pgpainless.key.RevocationAttributes;
|
||||
import org.pgpainless.policy.Policy;
|
||||
import org.pgpainless.signature.SignatureUtils;
|
||||
import org.pgpainless.signature.consumer.SignaturePicker;
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
|||
import org.pgpainless.key.protection.fixes.S2KUsageFix;
|
||||
import org.pgpainless.key.protection.passphrase_provider.SolitaryPassphraseProvider;
|
||||
import org.pgpainless.key.util.KeyRingUtils;
|
||||
import org.pgpainless.key.util.RevocationAttributes;
|
||||
import org.pgpainless.key.RevocationAttributes;
|
||||
import org.pgpainless.signature.builder.DirectKeySelfSignatureBuilder;
|
||||
import org.pgpainless.signature.builder.PrimaryKeyBindingSignatureBuilder;
|
||||
import org.pgpainless.signature.builder.RevocationSignatureBuilder;
|
||||
|
@ -48,7 +48,7 @@ import org.pgpainless.signature.subpackets.SelfSignatureSubpackets;
|
|||
import org.pgpainless.signature.subpackets.SignatureSubpackets;
|
||||
import org.pgpainless.signature.subpackets.SignatureSubpacketsHelper;
|
||||
import org.pgpainless.signature.subpackets.SignatureSubpacketsUtil;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
import org.pgpainless.util.selection.userid.SelectUserId;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
|
|
@ -20,10 +20,10 @@ import org.pgpainless.key.OpenPgpFingerprint;
|
|||
import org.pgpainless.key.generation.KeySpec;
|
||||
import org.pgpainless.key.protection.KeyRingProtectionSettings;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.util.RevocationAttributes;
|
||||
import org.pgpainless.key.RevocationAttributes;
|
||||
import org.pgpainless.signature.subpackets.RevocationSignatureSubpackets;
|
||||
import org.pgpainless.signature.subpackets.SelfSignatureSubpackets;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
import org.pgpainless.util.selection.userid.SelectUserId;
|
||||
|
||||
public interface SecretKeyRingEditorInterface {
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
|||
import org.bouncycastle.util.io.Streams;
|
||||
import org.pgpainless.implementation.ImplementationFactory;
|
||||
import org.pgpainless.key.collection.PGPKeyRingCollection;
|
||||
import org.pgpainless.util.ArmorUtils;
|
||||
import org.pgpainless.ascii_armor.ArmorUtils;
|
||||
|
||||
public class KeyRingReader {
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor;
|
|||
import org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor;
|
||||
import org.pgpainless.implementation.ImplementationFactory;
|
||||
import org.pgpainless.key.protection.passphrase_provider.SecretKeyPassphraseProvider;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor;
|
|||
import org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor;
|
||||
import org.pgpainless.key.OpenPgpFingerprint;
|
||||
import org.pgpainless.key.protection.passphrase_provider.SecretKeyPassphraseProvider;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
/**
|
||||
* Implementation of the {@link SecretKeyRingProtector} which holds a map of key ids and their passwords.
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.bouncycastle.openpgp.PGPSecretKey;
|
|||
import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor;
|
||||
import org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor;
|
||||
import org.pgpainless.key.protection.passphrase_provider.SecretKeyPassphraseProvider;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
/**
|
||||
* Provides {@link PBESecretKeyDecryptor} and {@link PBESecretKeyEncryptor} objects while getting the passphrases
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor;
|
|||
import org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor;
|
||||
import org.pgpainless.key.protection.passphrase_provider.SecretKeyPassphraseProvider;
|
||||
import org.pgpainless.key.protection.passphrase_provider.SolitaryPassphraseProvider;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
/**
|
||||
* Task of the {@link SecretKeyRingProtector} is to map encryptor/decryptor objects to key-ids.
|
||||
|
|
|
@ -13,7 +13,7 @@ import org.pgpainless.exception.KeyIntegrityException;
|
|||
import org.pgpainless.exception.WrongPassphraseException;
|
||||
import org.pgpainless.key.info.KeyInfo;
|
||||
import org.pgpainless.key.util.PublicKeyParameterValidationUtil;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public final class UnlockSecretKey {
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ package org.pgpainless.key.protection.passphrase_provider;
|
|||
import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
/**
|
||||
* Implementation of the {@link SecretKeyPassphraseProvider} that holds a map of different {@link Passphrase passphrases}.
|
||||
|
|
|
@ -7,7 +7,7 @@ package org.pgpainless.key.protection.passphrase_provider;
|
|||
import javax.annotation.Nullable;
|
||||
|
||||
import org.bouncycastle.openpgp.PGPSecretKey;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
/**
|
||||
* Interface to allow the user to provide a {@link Passphrase} for an encrypted OpenPGP secret key.
|
||||
|
|
|
@ -6,7 +6,7 @@ package org.pgpainless.key.protection.passphrase_provider;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
/**
|
||||
* Implementation of the {@link SecretKeyPassphraseProvider} that holds a single {@link Passphrase}.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.util;
|
||||
package org.pgpainless.policy;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
|
@ -21,7 +21,6 @@ import org.pgpainless.algorithm.HashAlgorithm;
|
|||
import org.pgpainless.algorithm.PublicKeyAlgorithm;
|
||||
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||
import org.pgpainless.util.DateUtil;
|
||||
import org.pgpainless.util.NotationRegistry;
|
||||
|
||||
/**
|
||||
* Policy class used to configure acceptable algorithm suites etc.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.util;
|
||||
package org.pgpainless.s2k;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.util;
|
||||
package org.pgpainless.s2k;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
// SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/**
|
||||
* Classes related to symmetric encryption using S2K mechanisms.
|
||||
*/
|
||||
package org.pgpainless.s2k;
|
|
@ -38,9 +38,9 @@ import org.pgpainless.algorithm.negotiation.HashAlgorithmNegotiator;
|
|||
import org.pgpainless.implementation.ImplementationFactory;
|
||||
import org.pgpainless.key.OpenPgpFingerprint;
|
||||
import org.pgpainless.key.util.OpenPgpKeyAttributeUtil;
|
||||
import org.pgpainless.key.util.RevocationAttributes;
|
||||
import org.pgpainless.key.RevocationAttributes;
|
||||
import org.pgpainless.signature.subpackets.SignatureSubpacketsUtil;
|
||||
import org.pgpainless.util.ArmorUtils;
|
||||
import org.pgpainless.ascii_armor.ArmorUtils;
|
||||
|
||||
/**
|
||||
* Utility methods related to signatures.
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.pgpainless.policy.Policy;
|
|||
import org.pgpainless.signature.SignatureUtils;
|
||||
import org.pgpainless.signature.subpackets.SignatureSubpacketsUtil;
|
||||
import org.pgpainless.util.DateUtil;
|
||||
import org.pgpainless.util.NotationRegistry;
|
||||
import org.pgpainless.policy.NotationRegistry;
|
||||
|
||||
/**
|
||||
* A collection of validators that perform validation steps over signatures.
|
||||
|
|
|
@ -8,7 +8,7 @@ import javax.annotation.Nonnull;
|
|||
import javax.annotation.Nullable;
|
||||
|
||||
import org.bouncycastle.bcpg.sig.RevocationReason;
|
||||
import org.pgpainless.key.util.RevocationAttributes;
|
||||
import org.pgpainless.key.RevocationAttributes;
|
||||
|
||||
public interface RevocationSignatureSubpackets extends BaseSignatureSubpackets {
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ import org.pgpainless.algorithm.HashAlgorithm;
|
|||
import org.pgpainless.algorithm.KeyFlag;
|
||||
import org.pgpainless.algorithm.PublicKeyAlgorithm;
|
||||
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||
import org.pgpainless.key.util.RevocationAttributes;
|
||||
import org.pgpainless.key.RevocationAttributes;
|
||||
|
||||
public class SignatureSubpackets
|
||||
implements BaseSignatureSubpackets, SelfSignatureSubpackets, CertificationSubpackets, RevocationSignatureSubpackets {
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.pgpainless.algorithm.Feature;
|
|||
import org.pgpainless.algorithm.HashAlgorithm;
|
||||
import org.pgpainless.algorithm.KeyFlag;
|
||||
import org.pgpainless.algorithm.PublicKeyAlgorithm;
|
||||
import org.pgpainless.key.util.RevocationAttributes;
|
||||
import org.pgpainless.key.RevocationAttributes;
|
||||
|
||||
public class SignatureSubpacketsHelper {
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.pgpainless.implementation.ImplementationFactory;
|
|||
import org.pgpainless.key.SubkeyIdentifier;
|
||||
import org.pgpainless.key.info.KeyRingInfo;
|
||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
/**
|
||||
* This test is used to investigate, how messages of the form
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.pgpainless.key.generation.type.rsa.RsaLength;
|
|||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||
import org.pgpainless.key.util.KeyIdUtil;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class ModifiedPublicKeysInvestigation {
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@ import org.pgpainless.decryption_verification.DecryptionStream;
|
|||
import org.pgpainless.key.OpenPgpV4Fingerprint;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.signature.SignatureUtils;
|
||||
import org.pgpainless.util.ArmoredInputStreamFactory;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.ascii_armor.ArmoredInputStreamFactory;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class AsciiArmorCRCTests {
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ import org.pgpainless.key.protection.SecretKeyRingProtector;
|
|||
import org.pgpainless.signature.consumer.CertificateValidator;
|
||||
import org.pgpainless.signature.SignatureUtils;
|
||||
import org.pgpainless.signature.consumer.SignatureVerifier;
|
||||
import org.pgpainless.util.ArmorUtils;
|
||||
import org.pgpainless.ascii_armor.ArmorUtils;
|
||||
import org.pgpainless.util.TestUtils;
|
||||
|
||||
public class CleartextSignatureVerificationTest {
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.pgpainless.key.SubkeyIdentifier;
|
|||
import org.pgpainless.key.info.KeyRingInfo;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.passphrase_provider.SecretKeyPassphraseProvider;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class MissingPassphraseForDecryptionTest {
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.pgpainless.exception.MessageNotIntegrityProtectedException;
|
|||
import org.pgpainless.exception.ModificationDetectionException;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class ModificationDetectionTests {
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.pgpainless.PGPainless;
|
|||
import org.pgpainless.key.protection.CachingSecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.passphrase_provider.SecretKeyPassphraseProvider;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class PostponeDecryptionUsingKeyWithMissingPassphraseTest {
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ import org.pgpainless.PGPainless;
|
|||
import org.pgpainless.algorithm.HashAlgorithm;
|
||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||
import org.pgpainless.policy.Policy;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class WrongSignerUserIdTest {
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ import org.pgpainless.key.protection.SecretKeyRingProtector;
|
|||
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.ascii_armor.ArmoredOutputStreamFactory;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class EncryptDecryptTest {
|
||||
|
|
|
@ -35,7 +35,7 @@ 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.key.util.KeyRingUtils;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class EncryptionOptionsTest {
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.junit.jupiter.api.TestTemplate;
|
|||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class EncryptionStreamClosedTest {
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ import org.pgpainless.key.info.KeyRingInfo;
|
|||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.util.KeyRingUtils;
|
||||
import org.pgpainless.util.MultiMap;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class SigningTest {
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.pgpainless.encryption_signing.EncryptionStream;
|
|||
import org.pgpainless.encryption_signing.ProducerOptions;
|
||||
import org.pgpainless.encryption_signing.SigningOptions;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class Encrypt {
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ import org.pgpainless.key.generation.type.ecc.EllipticCurve;
|
|||
import org.pgpainless.key.generation.type.eddsa.EdDSACurve;
|
||||
import org.pgpainless.key.generation.type.rsa.RsaLength;
|
||||
import org.pgpainless.key.info.KeyRingInfo;
|
||||
import org.pgpainless.key.util.UserId;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.key.UserId;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
/**
|
||||
* This class demonstrates how to use PGPainless to generate secret keys.
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.pgpainless.PGPainless;
|
|||
import org.pgpainless.algorithm.HashAlgorithm;
|
||||
import org.pgpainless.algorithm.PublicKeyAlgorithm;
|
||||
import org.pgpainless.policy.Policy;
|
||||
import org.pgpainless.util.NotationRegistry;
|
||||
import org.pgpainless.policy.NotationRegistry;
|
||||
|
||||
/**
|
||||
* PGPainless comes with an algorithm policy.
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.pgpainless.key.info.KeyRingInfo;
|
|||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||
import org.pgpainless.util.DateUtil;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
/**
|
||||
* PGPainless offers a simple API to modify keys by adding and replacing signatures and/or subkeys.
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.pgpainless.encryption_signing.ProducerOptions;
|
|||
import org.pgpainless.encryption_signing.SigningOptions;
|
||||
import org.pgpainless.key.SubkeyIdentifier;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.util.ArmorUtils;
|
||||
import org.pgpainless.ascii_armor.ArmorUtils;
|
||||
|
||||
public class Sign {
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.pgpainless.key.TestKeys;
|
|||
import org.pgpainless.key.protection.CachingSecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
/**
|
||||
* {@link PGPSecretKey PGPSecretKeys} are often password protected to prevent unauthorized access.
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
|||
import org.bouncycastle.openpgp.PGPUtil;
|
||||
import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator;
|
||||
import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class TestKeys {
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
package org.pgpainless.key;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.pgpainless.key.util.UserId;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||
|
|
|
@ -28,8 +28,8 @@ import org.pgpainless.key.generation.type.eddsa.EdDSACurve;
|
|||
import org.pgpainless.key.generation.type.rsa.RsaLength;
|
||||
import org.pgpainless.key.generation.type.xdh.XDHSpec;
|
||||
import org.pgpainless.key.info.KeyInfo;
|
||||
import org.pgpainless.key.util.UserId;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.key.UserId;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class BrainpoolKeyGenerationTest {
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.pgpainless.key.generation.type.eddsa.EdDSACurve;
|
|||
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.key.UserId;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class GenerateEllipticCurveKeyTest {
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.pgpainless.algorithm.KeyFlag;
|
|||
import org.pgpainless.key.generation.type.KeyType;
|
||||
import org.pgpainless.key.generation.type.rsa.RsaLength;
|
||||
import org.pgpainless.key.util.KeyRingUtils;
|
||||
import org.pgpainless.key.util.UserId;
|
||||
import org.pgpainless.key.UserId;
|
||||
import org.pgpainless.util.DateUtil;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.pgpainless.algorithm.KeyFlag;
|
|||
import org.pgpainless.key.generation.type.KeyType;
|
||||
import org.pgpainless.key.generation.type.rsa.RsaLength;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
/**
|
||||
* Reproduce behavior of https://github.com/pgpainless/pgpainless/issues/16
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.pgpainless.key.generation.type.xdh.XDHSpec;
|
|||
import org.pgpainless.key.info.KeyRingInfo;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.signature.subpackets.SelfSignatureSubpackets;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class KeyGenerationSubpacketsTest {
|
||||
|
||||
|
|
|
@ -49,10 +49,10 @@ import org.pgpainless.key.generation.type.eddsa.EdDSACurve;
|
|||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||
import org.pgpainless.key.util.KeyRingUtils;
|
||||
import org.pgpainless.key.util.RevocationAttributes;
|
||||
import org.pgpainless.key.util.UserId;
|
||||
import org.pgpainless.key.RevocationAttributes;
|
||||
import org.pgpainless.key.UserId;
|
||||
import org.pgpainless.util.DateUtil;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class KeyRingInfoTest {
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.pgpainless.key.generation.type.xdh.XDHSpec;
|
|||
import org.pgpainless.key.protection.PasswordBasedSecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||
import org.pgpainless.key.util.RevocationAttributes;
|
||||
import org.pgpainless.key.RevocationAttributes;
|
||||
|
||||
public class UserIdRevocationTest {
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ 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.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class AddSubKeyTest {
|
||||
|
|
|
@ -26,9 +26,9 @@ import org.pgpainless.key.info.KeyRingInfo;
|
|||
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.key.UserId;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class AddUserIdTest {
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.pgpainless.key.protection.KeyRingProtectionSettings;
|
|||
import org.pgpainless.key.protection.PasswordBasedSecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class ChangeSecretKeyRingPassphraseTest {
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import org.bouncycastle.openpgp.PGPException;
|
|||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class GnuDummyS2KChangePassphraseTest {
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.pgpainless.key.generation.type.rsa.RsaLength;
|
|||
import org.pgpainless.key.modification.secretkeyring.SecretKeyRingEditorInterface;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.policy.Policy;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class RefuseToAddWeakSubkeyTest {
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.pgpainless.PGPainless;
|
|||
import org.pgpainless.key.TestKeys;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.util.KeyRingUtils;
|
||||
import org.pgpainless.key.util.RevocationAttributes;
|
||||
import org.pgpainless.key.RevocationAttributes;
|
||||
|
||||
public class RevocationCertificateTest {
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.junit.jupiter.api.TestTemplate;
|
|||
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.ascii_armor.ArmoredOutputStreamFactory;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
/**
|
||||
|
|
|
@ -34,12 +34,12 @@ import org.pgpainless.key.TestKeys;
|
|||
import org.pgpainless.key.modification.secretkeyring.SecretKeyRingEditorInterface;
|
||||
import org.pgpainless.key.protection.PasswordBasedSecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.util.RevocationAttributes;
|
||||
import org.pgpainless.key.RevocationAttributes;
|
||||
import org.pgpainless.signature.SignatureUtils;
|
||||
import org.pgpainless.signature.subpackets.RevocationSignatureSubpackets;
|
||||
import org.pgpainless.signature.subpackets.SignatureSubpacketsUtil;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class RevokeSubKeyTest {
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import org.junit.jupiter.api.Test;
|
|||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.key.info.KeyRingInfo;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.util.RevocationAttributes;
|
||||
import org.pgpainless.key.RevocationAttributes;
|
||||
import org.pgpainless.util.selection.userid.SelectUserId;
|
||||
|
||||
public class RevokeUserIdsTest {
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.junit.jupiter.api.Test;
|
|||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.key.OpenPgpV4Fingerprint;
|
||||
import org.pgpainless.key.util.KeyRingUtils;
|
||||
import org.pgpainless.util.ArmorUtils;
|
||||
import org.pgpainless.ascii_armor.ArmorUtils;
|
||||
|
||||
public class KeyRingCollectionReaderTest {
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ import org.pgpainless.key.OpenPgpV4Fingerprint;
|
|||
import org.pgpainless.key.collection.PGPKeyRingCollection;
|
||||
import org.pgpainless.key.util.KeyRingUtils;
|
||||
import org.pgpainless.signature.SignatureUtils;
|
||||
import org.pgpainless.util.ArmoredOutputStreamFactory;
|
||||
import org.pgpainless.ascii_armor.ArmoredOutputStreamFactory;
|
||||
import org.pgpainless.util.TestUtils;
|
||||
|
||||
class KeyRingReaderTest {
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test;
|
|||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.key.TestKeys;
|
||||
import org.pgpainless.key.protection.passphrase_provider.SecretKeyPassphraseProvider;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class CachingSecretKeyRingProtectorTest {
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
|||
import org.junit.jupiter.api.Test;
|
||||
import org.pgpainless.key.TestKeys;
|
||||
import org.pgpainless.key.protection.passphrase_provider.MapBasedPassphraseProvider;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class MapBasedPassphraseProviderTest {
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import org.junit.jupiter.api.Test;
|
|||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.key.TestKeys;
|
||||
import org.pgpainless.key.protection.passphrase_provider.SecretKeyPassphraseProvider;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class PassphraseProtectedKeyTest {
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class PassphraseTest {
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ 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.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
|
||||
public class SecretKeyRingProtectorTest {
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
|||
import org.junit.jupiter.api.Test;
|
||||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.exception.WrongPassphraseException;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class UnlockSecretKeyTest {
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.pgpainless.PGPainless;
|
|||
import org.pgpainless.decryption_verification.ConsumerOptions;
|
||||
import org.pgpainless.decryption_verification.DecryptionStream;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class S2KUsageFixTest {
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
package org.pgpainless.key.util;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.pgpainless.key.RevocationAttributes;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
|
|
|
@ -53,9 +53,9 @@ import org.pgpainless.implementation.ImplementationFactory;
|
|||
import org.pgpainless.key.OpenPgpFingerprint;
|
||||
import org.pgpainless.key.TestKeys;
|
||||
import org.pgpainless.key.protection.UnlockSecretKey;
|
||||
import org.pgpainless.key.util.RevocationAttributes;
|
||||
import org.pgpainless.key.RevocationAttributes;
|
||||
import org.pgpainless.util.DateUtil;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class SignatureSubpacketsTest {
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.pgpainless.encryption_signing.EncryptionOptions;
|
|||
import org.pgpainless.encryption_signing.EncryptionStream;
|
||||
import org.pgpainless.encryption_signing.ProducerOptions;
|
||||
import org.pgpainless.util.TestAllImplementations;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class MultiPassphraseSymmetricEncryptionTest {
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.pgpainless.key.protection.KeyRingProtectionSettings;
|
|||
import org.pgpainless.key.protection.PasswordBasedSecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.passphrase_provider.SolitaryPassphraseProvider;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
/**
|
||||
* Test parallel symmetric and public key encryption/decryption.
|
||||
|
|
|
@ -34,11 +34,15 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
|||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.algorithm.HashAlgorithm;
|
||||
import org.pgpainless.algorithm.KeyFlag;
|
||||
import org.pgpainless.ascii_armor.ArmorUtils;
|
||||
import org.pgpainless.ascii_armor.ArmoredInputStreamFactory;
|
||||
import org.pgpainless.ascii_armor.ArmoredOutputStreamFactory;
|
||||
import org.pgpainless.implementation.ImplementationFactory;
|
||||
import org.pgpainless.key.TestKeys;
|
||||
import org.pgpainless.key.generation.KeySpec;
|
||||
import org.pgpainless.key.generation.type.ecc.EllipticCurve;
|
||||
import org.pgpainless.key.generation.type.ecc.ecdsa.ECDSA;
|
||||
import org.pgpainless.s2k.Passphrase;
|
||||
|
||||
public class ArmorUtilsTest {
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ package org.pgpainless.util;
|
|||
|
||||
import org.bouncycastle.bcpg.ArmoredInputStream;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.pgpainless.ascii_armor.ArmoredInputStreamFactory;
|
||||
import org.pgpainless.ascii_armor.CRCingArmoredInputStreamWrapper;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
|
|
|
@ -9,6 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
|||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.pgpainless.policy.NotationRegistry;
|
||||
|
||||
public class NotationRegistryTest {
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
|||
import org.junit.jupiter.api.Test;
|
||||
import org.pgpainless.PGPainless;
|
||||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.util.UserId;
|
||||
import org.pgpainless.key.UserId;
|
||||
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue