From 68575f9f1e61949771d7b6730d570514ef229dd7 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Wed, 7 Sep 2022 13:35:58 +0200 Subject: [PATCH] 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 --- CHANGELOG.md | 10 ++++++++++ .../pgpainless/cli/commands/GenerateCertCmdTest.java | 2 +- .../src/main/java/org/pgpainless/PGPainless.java | 2 +- .../pgpainless/{util => ascii_armor}/ArmorUtils.java | 4 +++- .../ArmoredInputStreamFactory.java | 2 +- .../ArmoredOutputStreamFactory.java | 2 +- .../CRCingArmoredInputStreamWrapper.java | 2 +- .../java/org/pgpainless/ascii_armor/package-info.java | 8 ++++++++ .../decryption_verification/ConsumerOptions.java | 4 ++-- .../DecryptionStreamFactory.java | 6 +++--- .../decryption_verification/MessageInspector.java | 2 +- .../decryption_verification/OpenPgpMetadata.java | 5 +++-- .../cleartext_signatures/ClearsignedMessageUtil.java | 2 +- .../encryption_signing/EncryptionOptions.java | 2 +- .../encryption_signing/EncryptionStream.java | 4 ++-- .../pgpainless/encryption_signing/ProducerOptions.java | 3 ++- .../implementation/BcImplementationFactory.java | 2 +- .../implementation/ImplementationFactory.java | 2 +- .../implementation/JceImplementationFactory.java | 2 +- .../key/{util => }/RevocationAttributes.java | 2 +- .../java/org/pgpainless/key/{util => }/UserId.java | 2 +- .../key/collection/PGPKeyRingCollection.java | 2 +- .../org/pgpainless/key/generation/KeyRingBuilder.java | 2 +- .../key/generation/KeyRingBuilderInterface.java | 4 ++-- .../pgpainless/key/generation/KeyRingTemplates.java | 4 ++-- .../main/java/org/pgpainless/key/info/KeyRingInfo.java | 2 +- .../secretkeyring/SecretKeyRingEditor.java | 4 ++-- .../secretkeyring/SecretKeyRingEditorInterface.java | 4 ++-- .../java/org/pgpainless/key/parsing/KeyRingReader.java | 2 +- .../key/protection/BaseSecretKeyRingProtector.java | 2 +- .../key/protection/CachingSecretKeyRingProtector.java | 2 +- .../PasswordBasedSecretKeyRingProtector.java | 2 +- .../key/protection/SecretKeyRingProtector.java | 2 +- .../org/pgpainless/key/protection/UnlockSecretKey.java | 2 +- .../MapBasedPassphraseProvider.java | 2 +- .../SecretKeyPassphraseProvider.java | 2 +- .../SolitaryPassphraseProvider.java | 2 +- .../pgpainless/{util => policy}/NotationRegistry.java | 2 +- .../src/main/java/org/pgpainless/policy/Policy.java | 1 - .../java/org/pgpainless/{util => s2k}/Passphrase.java | 2 +- .../java/org/pgpainless/{util => s2k}/SessionKey.java | 2 +- .../src/main/java/org/pgpainless/s2k/package-info.java | 8 ++++++++ .../java/org/pgpainless/signature/SignatureUtils.java | 4 ++-- .../signature/consumer/SignatureValidator.java | 2 +- .../subpackets/RevocationSignatureSubpackets.java | 2 +- .../signature/subpackets/SignatureSubpackets.java | 2 +- .../subpackets/SignatureSubpacketsHelper.java | 2 +- .../InvestigateMultiSEIPMessageHandlingTest.java | 2 +- .../ModifiedPublicKeysInvestigation.java | 2 +- .../test/java/org/bouncycastle/AsciiArmorCRCTests.java | 4 ++-- .../CleartextSignatureVerificationTest.java | 2 +- .../MissingPassphraseForDecryptionTest.java | 2 +- .../ModificationDetectionTests.java | 2 +- ...oneDecryptionUsingKeyWithMissingPassphraseTest.java | 2 +- .../decryption_verification/WrongSignerUserIdTest.java | 2 +- .../encryption_signing/EncryptDecryptTest.java | 2 +- .../encryption_signing/EncryptionOptionsTest.java | 2 +- .../encryption_signing/EncryptionStreamClosedTest.java | 2 +- .../org/pgpainless/encryption_signing/SigningTest.java | 2 +- .../src/test/java/org/pgpainless/example/Encrypt.java | 2 +- .../test/java/org/pgpainless/example/GenerateKeys.java | 4 ++-- .../test/java/org/pgpainless/example/ManagePolicy.java | 2 +- .../test/java/org/pgpainless/example/ModifyKeys.java | 2 +- .../src/test/java/org/pgpainless/example/Sign.java | 2 +- .../java/org/pgpainless/example/UnlockSecretKeys.java | 2 +- .../src/test/java/org/pgpainless/key/TestKeys.java | 2 +- .../src/test/java/org/pgpainless/key/UserIdTest.java | 1 - .../key/generation/BrainpoolKeyGenerationTest.java | 4 ++-- .../key/generation/GenerateEllipticCurveKeyTest.java | 2 +- .../GenerateKeyWithAdditionalUserIdTest.java | 2 +- .../generation/GenerateWithEmptyPassphraseTest.java | 2 +- .../key/generation/KeyGenerationSubpacketsTest.java | 2 +- .../java/org/pgpainless/key/info/KeyRingInfoTest.java | 6 +++--- .../org/pgpainless/key/info/UserIdRevocationTest.java | 2 +- .../org/pgpainless/key/modification/AddSubKeyTest.java | 2 +- .../org/pgpainless/key/modification/AddUserIdTest.java | 4 ++-- .../ChangeSecretKeyRingPassphraseTest.java | 2 +- .../modification/GnuDummyS2KChangePassphraseTest.java | 2 +- .../key/modification/RefuseToAddWeakSubkeyTest.java | 2 +- .../key/modification/RevocationCertificateTest.java | 2 +- ...RevokeKeyWithGenericCertificationSignatureTest.java | 2 +- .../pgpainless/key/modification/RevokeSubKeyTest.java | 4 ++-- .../pgpainless/key/modification/RevokeUserIdsTest.java | 2 +- .../key/parsing/KeyRingCollectionReaderTest.java | 2 +- .../org/pgpainless/key/parsing/KeyRingReaderTest.java | 2 +- .../protection/CachingSecretKeyRingProtectorTest.java | 2 +- .../key/protection/MapBasedPassphraseProviderTest.java | 2 +- .../key/protection/PassphraseProtectedKeyTest.java | 2 +- .../org/pgpainless/key/protection/PassphraseTest.java | 2 +- .../key/protection/SecretKeyRingProtectorTest.java | 2 +- .../pgpainless/key/protection/UnlockSecretKeyTest.java | 2 +- .../key/protection/fixes/S2KUsageFixTest.java | 2 +- .../pgpainless/key/util/RevocationAttributesTest.java | 1 + .../signature/subpackets/SignatureSubpacketsTest.java | 4 ++-- .../MultiPassphraseSymmetricEncryptionTest.java | 2 +- .../symmetric_encryption/SymmetricEncryptionTest.java | 2 +- .../test/java/org/pgpainless/util/ArmorUtilsTest.java | 4 ++++ .../pgpainless/util/ArmoredInputStreamFactoryTest.java | 2 ++ .../java/org/pgpainless/util/NotationRegistryTest.java | 1 + .../util/selection/userid/SelectUserIdTest.java | 2 +- .../src/main/java/org/pgpainless/sop/ArmorImpl.java | 2 +- .../src/main/java/org/pgpainless/sop/DecryptImpl.java | 6 +++--- .../main/java/org/pgpainless/sop/DetachedSignImpl.java | 4 ++-- .../src/main/java/org/pgpainless/sop/EncryptImpl.java | 2 +- .../main/java/org/pgpainless/sop/ExtractCertImpl.java | 2 +- .../main/java/org/pgpainless/sop/GenerateKeyImpl.java | 4 ++-- .../main/java/org/pgpainless/sop/InlineDetachImpl.java | 2 +- .../main/java/org/pgpainless/sop/InlineSignImpl.java | 2 +- .../sop/MatchMakingSecretKeyRingProtector.java | 2 +- .../src/test/java/org/pgpainless/sop/ArmorTest.java | 2 +- .../java/org/pgpainless/sop/IncapableKeysTest.java | 2 +- 111 files changed, 162 insertions(+), 126 deletions(-) rename pgpainless-core/src/main/java/org/pgpainless/{util => ascii_armor}/ArmorUtils.java (99%) rename pgpainless-core/src/main/java/org/pgpainless/{util => ascii_armor}/ArmoredInputStreamFactory.java (95%) rename pgpainless-core/src/main/java/org/pgpainless/{util => ascii_armor}/ArmoredOutputStreamFactory.java (98%) rename pgpainless-core/src/main/java/org/pgpainless/{util => ascii_armor}/CRCingArmoredInputStreamWrapper.java (99%) create mode 100644 pgpainless-core/src/main/java/org/pgpainless/ascii_armor/package-info.java rename pgpainless-core/src/main/java/org/pgpainless/key/{util => }/RevocationAttributes.java (99%) rename pgpainless-core/src/main/java/org/pgpainless/key/{util => }/UserId.java (99%) rename pgpainless-core/src/main/java/org/pgpainless/{util => policy}/NotationRegistry.java (97%) rename pgpainless-core/src/main/java/org/pgpainless/{util => s2k}/Passphrase.java (99%) rename pgpainless-core/src/main/java/org/pgpainless/{util => s2k}/SessionKey.java (98%) create mode 100644 pgpainless-core/src/main/java/org/pgpainless/s2k/package-info.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 250a80c2..431e83e7 100644 --- a/CHANGELOG.md +++ b/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 diff --git a/pgpainless-cli/src/test/java/org/pgpainless/cli/commands/GenerateCertCmdTest.java b/pgpainless-cli/src/test/java/org/pgpainless/cli/commands/GenerateCertCmdTest.java index 63afc39f..5b87f12d 100644 --- a/pgpainless-cli/src/test/java/org/pgpainless/cli/commands/GenerateCertCmdTest.java +++ b/pgpainless-cli/src/test/java/org/pgpainless/cli/commands/GenerateCertCmdTest.java @@ -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 { diff --git a/pgpainless-core/src/main/java/org/pgpainless/PGPainless.java b/pgpainless-core/src/main/java/org/pgpainless/PGPainless.java index 9ff2a3b0..2cc5dfda 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/PGPainless.java +++ b/pgpainless-core/src/main/java/org/pgpainless/PGPainless.java @@ -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 { diff --git a/pgpainless-core/src/main/java/org/pgpainless/util/ArmorUtils.java b/pgpainless-core/src/main/java/org/pgpainless/ascii_armor/ArmorUtils.java similarity index 99% rename from pgpainless-core/src/main/java/org/pgpainless/util/ArmorUtils.java rename to pgpainless-core/src/main/java/org/pgpainless/ascii_armor/ArmorUtils.java index 160d8d0a..a8ecf760 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/util/ArmorUtils.java +++ b/pgpainless-core/src/main/java/org/pgpainless/ascii_armor/ArmorUtils.java @@ -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 { diff --git a/pgpainless-core/src/main/java/org/pgpainless/util/ArmoredInputStreamFactory.java b/pgpainless-core/src/main/java/org/pgpainless/ascii_armor/ArmoredInputStreamFactory.java similarity index 95% rename from pgpainless-core/src/main/java/org/pgpainless/util/ArmoredInputStreamFactory.java rename to pgpainless-core/src/main/java/org/pgpainless/ascii_armor/ArmoredInputStreamFactory.java index 0c5ceeaf..f843f99a 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/util/ArmoredInputStreamFactory.java +++ b/pgpainless-core/src/main/java/org/pgpainless/ascii_armor/ArmoredInputStreamFactory.java @@ -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; diff --git a/pgpainless-core/src/main/java/org/pgpainless/util/ArmoredOutputStreamFactory.java b/pgpainless-core/src/main/java/org/pgpainless/ascii_armor/ArmoredOutputStreamFactory.java similarity index 98% rename from pgpainless-core/src/main/java/org/pgpainless/util/ArmoredOutputStreamFactory.java rename to pgpainless-core/src/main/java/org/pgpainless/ascii_armor/ArmoredOutputStreamFactory.java index 2e1377a0..98d268cc 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/util/ArmoredOutputStreamFactory.java +++ b/pgpainless-core/src/main/java/org/pgpainless/ascii_armor/ArmoredOutputStreamFactory.java @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.util; +package org.pgpainless.ascii_armor; import java.io.OutputStream; diff --git a/pgpainless-core/src/main/java/org/pgpainless/util/CRCingArmoredInputStreamWrapper.java b/pgpainless-core/src/main/java/org/pgpainless/ascii_armor/CRCingArmoredInputStreamWrapper.java similarity index 99% rename from pgpainless-core/src/main/java/org/pgpainless/util/CRCingArmoredInputStreamWrapper.java rename to pgpainless-core/src/main/java/org/pgpainless/ascii_armor/CRCingArmoredInputStreamWrapper.java index 2c43339b..78c98723 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/util/CRCingArmoredInputStreamWrapper.java +++ b/pgpainless-core/src/main/java/org/pgpainless/ascii_armor/CRCingArmoredInputStreamWrapper.java @@ -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; diff --git a/pgpainless-core/src/main/java/org/pgpainless/ascii_armor/package-info.java b/pgpainless-core/src/main/java/org/pgpainless/ascii_armor/package-info.java new file mode 100644 index 00000000..e9eda1cb --- /dev/null +++ b/pgpainless-core/src/main/java/org/pgpainless/ascii_armor/package-info.java @@ -0,0 +1,8 @@ +// SPDX-FileCopyrightText: 2022 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + +/** + * Classes related to ASCII armoring. + */ +package org.pgpainless.ascii_armor; diff --git a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/ConsumerOptions.java b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/ConsumerOptions.java index b6117a60..5c1c6512 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/ConsumerOptions.java +++ b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/ConsumerOptions.java @@ -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. diff --git a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStreamFactory.java b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStreamFactory.java index 77ad92bb..60e3490c 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStreamFactory.java +++ b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStreamFactory.java @@ -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; diff --git a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/MessageInspector.java b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/MessageInspector.java index 3dda0f5d..e47e9768 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/MessageInspector.java +++ b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/MessageInspector.java @@ -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. diff --git a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/OpenPgpMetadata.java b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/OpenPgpMetadata.java index 130ea554..8e0cddc2 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/OpenPgpMetadata.java +++ b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/OpenPgpMetadata.java @@ -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 diff --git a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/cleartext_signatures/ClearsignedMessageUtil.java b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/cleartext_signatures/ClearsignedMessageUtil.java index cd0f6b35..06e16c8c 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/cleartext_signatures/ClearsignedMessageUtil.java +++ b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/cleartext_signatures/ClearsignedMessageUtil.java @@ -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. diff --git a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionOptions.java b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionOptions.java index 6d2ca642..ccc13b25 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionOptions.java +++ b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionOptions.java @@ -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. diff --git a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionStream.java b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionStream.java index 50f5cb5f..c725e9aa 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionStream.java +++ b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionStream.java @@ -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; diff --git a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/ProducerOptions.java b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/ProducerOptions.java index a015a581..47e4db1b 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/ProducerOptions.java +++ b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/ProducerOptions.java @@ -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 diff --git a/pgpainless-core/src/main/java/org/pgpainless/implementation/BcImplementationFactory.java b/pgpainless-core/src/main/java/org/pgpainless/implementation/BcImplementationFactory.java index c8e20521..1093d21e 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/implementation/BcImplementationFactory.java +++ b/pgpainless-core/src/main/java/org/pgpainless/implementation/BcImplementationFactory.java @@ -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 { diff --git a/pgpainless-core/src/main/java/org/pgpainless/implementation/ImplementationFactory.java b/pgpainless-core/src/main/java/org/pgpainless/implementation/ImplementationFactory.java index 94967dee..a5b3e020 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/implementation/ImplementationFactory.java +++ b/pgpainless-core/src/main/java/org/pgpainless/implementation/ImplementationFactory.java @@ -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 { diff --git a/pgpainless-core/src/main/java/org/pgpainless/implementation/JceImplementationFactory.java b/pgpainless-core/src/main/java/org/pgpainless/implementation/JceImplementationFactory.java index 504b197e..195617ed 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/implementation/JceImplementationFactory.java +++ b/pgpainless-core/src/main/java/org/pgpainless/implementation/JceImplementationFactory.java @@ -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 { diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/util/RevocationAttributes.java b/pgpainless-core/src/main/java/org/pgpainless/key/RevocationAttributes.java similarity index 99% rename from pgpainless-core/src/main/java/org/pgpainless/key/util/RevocationAttributes.java rename to pgpainless-core/src/main/java/org/pgpainless/key/RevocationAttributes.java index 60a02fea..2b56e468 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/util/RevocationAttributes.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/RevocationAttributes.java @@ -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; diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/util/UserId.java b/pgpainless-core/src/main/java/org/pgpainless/key/UserId.java similarity index 99% rename from pgpainless-core/src/main/java/org/pgpainless/key/util/UserId.java rename to pgpainless-core/src/main/java/org/pgpainless/key/UserId.java index ca233759..cdcdfc2a 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/util/UserId.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/UserId.java @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.key.util; +package org.pgpainless.key; import javax.annotation.Nonnull; diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/collection/PGPKeyRingCollection.java b/pgpainless-core/src/main/java/org/pgpainless/key/collection/PGPKeyRingCollection.java index 46aa2baf..2d4afe80 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/collection/PGPKeyRingCollection.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/collection/PGPKeyRingCollection.java @@ -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 diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilder.java b/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilder.java index 10970fc2..64b3b7d4 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilder.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilder.java @@ -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 { diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilderInterface.java b/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilderInterface.java index ecff123b..bdb69246 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilderInterface.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilderInterface.java @@ -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> { diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingTemplates.java b/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingTemplates.java index 444e7d74..2b7ceed5 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingTemplates.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingTemplates.java @@ -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 { diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java b/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java index b818290b..e577639e 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java @@ -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; diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/modification/secretkeyring/SecretKeyRingEditor.java b/pgpainless-core/src/main/java/org/pgpainless/key/modification/secretkeyring/SecretKeyRingEditor.java index 20876c36..c42c68ee 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/modification/secretkeyring/SecretKeyRingEditor.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/modification/secretkeyring/SecretKeyRingEditor.java @@ -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; diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/modification/secretkeyring/SecretKeyRingEditorInterface.java b/pgpainless-core/src/main/java/org/pgpainless/key/modification/secretkeyring/SecretKeyRingEditorInterface.java index 7014d518..df4bfdcd 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/modification/secretkeyring/SecretKeyRingEditorInterface.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/modification/secretkeyring/SecretKeyRingEditorInterface.java @@ -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 { diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/parsing/KeyRingReader.java b/pgpainless-core/src/main/java/org/pgpainless/key/parsing/KeyRingReader.java index b5b8ea65..dbfd8a30 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/parsing/KeyRingReader.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/parsing/KeyRingReader.java @@ -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 { diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/protection/BaseSecretKeyRingProtector.java b/pgpainless-core/src/main/java/org/pgpainless/key/protection/BaseSecretKeyRingProtector.java index 5b545c12..1b82063e 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/protection/BaseSecretKeyRingProtector.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/protection/BaseSecretKeyRingProtector.java @@ -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; diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/protection/CachingSecretKeyRingProtector.java b/pgpainless-core/src/main/java/org/pgpainless/key/protection/CachingSecretKeyRingProtector.java index 8cdb3efb..d81a045e 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/protection/CachingSecretKeyRingProtector.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/protection/CachingSecretKeyRingProtector.java @@ -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. diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/protection/PasswordBasedSecretKeyRingProtector.java b/pgpainless-core/src/main/java/org/pgpainless/key/protection/PasswordBasedSecretKeyRingProtector.java index c5745068..3b47b76b 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/protection/PasswordBasedSecretKeyRingProtector.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/protection/PasswordBasedSecretKeyRingProtector.java @@ -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 diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/protection/SecretKeyRingProtector.java b/pgpainless-core/src/main/java/org/pgpainless/key/protection/SecretKeyRingProtector.java index ee461a4e..7a5f786c 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/protection/SecretKeyRingProtector.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/protection/SecretKeyRingProtector.java @@ -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. diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/protection/UnlockSecretKey.java b/pgpainless-core/src/main/java/org/pgpainless/key/protection/UnlockSecretKey.java index 42a5b9b7..fd613f85 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/protection/UnlockSecretKey.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/protection/UnlockSecretKey.java @@ -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 { diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/protection/passphrase_provider/MapBasedPassphraseProvider.java b/pgpainless-core/src/main/java/org/pgpainless/key/protection/passphrase_provider/MapBasedPassphraseProvider.java index 859758b1..d63be71e 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/protection/passphrase_provider/MapBasedPassphraseProvider.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/protection/passphrase_provider/MapBasedPassphraseProvider.java @@ -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}. diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/protection/passphrase_provider/SecretKeyPassphraseProvider.java b/pgpainless-core/src/main/java/org/pgpainless/key/protection/passphrase_provider/SecretKeyPassphraseProvider.java index 59cb39ce..62dc55fc 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/protection/passphrase_provider/SecretKeyPassphraseProvider.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/protection/passphrase_provider/SecretKeyPassphraseProvider.java @@ -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. diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/protection/passphrase_provider/SolitaryPassphraseProvider.java b/pgpainless-core/src/main/java/org/pgpainless/key/protection/passphrase_provider/SolitaryPassphraseProvider.java index b439ef56..ffe5b8ac 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/protection/passphrase_provider/SolitaryPassphraseProvider.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/protection/passphrase_provider/SolitaryPassphraseProvider.java @@ -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}. diff --git a/pgpainless-core/src/main/java/org/pgpainless/util/NotationRegistry.java b/pgpainless-core/src/main/java/org/pgpainless/policy/NotationRegistry.java similarity index 97% rename from pgpainless-core/src/main/java/org/pgpainless/util/NotationRegistry.java rename to pgpainless-core/src/main/java/org/pgpainless/policy/NotationRegistry.java index 11aa7651..5ea3caa4 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/util/NotationRegistry.java +++ b/pgpainless-core/src/main/java/org/pgpainless/policy/NotationRegistry.java @@ -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; diff --git a/pgpainless-core/src/main/java/org/pgpainless/policy/Policy.java b/pgpainless-core/src/main/java/org/pgpainless/policy/Policy.java index ad9f0635..88a563e0 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/policy/Policy.java +++ b/pgpainless-core/src/main/java/org/pgpainless/policy/Policy.java @@ -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. diff --git a/pgpainless-core/src/main/java/org/pgpainless/util/Passphrase.java b/pgpainless-core/src/main/java/org/pgpainless/s2k/Passphrase.java similarity index 99% rename from pgpainless-core/src/main/java/org/pgpainless/util/Passphrase.java rename to pgpainless-core/src/main/java/org/pgpainless/s2k/Passphrase.java index 4cef145a..6fcaeb1d 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/util/Passphrase.java +++ b/pgpainless-core/src/main/java/org/pgpainless/s2k/Passphrase.java @@ -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; diff --git a/pgpainless-core/src/main/java/org/pgpainless/util/SessionKey.java b/pgpainless-core/src/main/java/org/pgpainless/s2k/SessionKey.java similarity index 98% rename from pgpainless-core/src/main/java/org/pgpainless/util/SessionKey.java rename to pgpainless-core/src/main/java/org/pgpainless/s2k/SessionKey.java index 1e71bb03..8cf650dd 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/util/SessionKey.java +++ b/pgpainless-core/src/main/java/org/pgpainless/s2k/SessionKey.java @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.util; +package org.pgpainless.s2k; import javax.annotation.Nonnull; diff --git a/pgpainless-core/src/main/java/org/pgpainless/s2k/package-info.java b/pgpainless-core/src/main/java/org/pgpainless/s2k/package-info.java new file mode 100644 index 00000000..ed7362ee --- /dev/null +++ b/pgpainless-core/src/main/java/org/pgpainless/s2k/package-info.java @@ -0,0 +1,8 @@ +// SPDX-FileCopyrightText: 2022 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + +/** + * Classes related to symmetric encryption using S2K mechanisms. + */ +package org.pgpainless.s2k; diff --git a/pgpainless-core/src/main/java/org/pgpainless/signature/SignatureUtils.java b/pgpainless-core/src/main/java/org/pgpainless/signature/SignatureUtils.java index 2b69a832..27a10aff 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/signature/SignatureUtils.java +++ b/pgpainless-core/src/main/java/org/pgpainless/signature/SignatureUtils.java @@ -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. diff --git a/pgpainless-core/src/main/java/org/pgpainless/signature/consumer/SignatureValidator.java b/pgpainless-core/src/main/java/org/pgpainless/signature/consumer/SignatureValidator.java index 56614f4f..34b7e5f2 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/signature/consumer/SignatureValidator.java +++ b/pgpainless-core/src/main/java/org/pgpainless/signature/consumer/SignatureValidator.java @@ -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. diff --git a/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/RevocationSignatureSubpackets.java b/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/RevocationSignatureSubpackets.java index 358437dc..f45e5bea 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/RevocationSignatureSubpackets.java +++ b/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/RevocationSignatureSubpackets.java @@ -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 { diff --git a/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpackets.java b/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpackets.java index a2eb1f7d..dd7fac08 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpackets.java +++ b/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpackets.java @@ -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 { diff --git a/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpacketsHelper.java b/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpacketsHelper.java index 8af60a03..59a67d19 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpacketsHelper.java +++ b/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpacketsHelper.java @@ -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 { diff --git a/pgpainless-core/src/test/java/investigations/InvestigateMultiSEIPMessageHandlingTest.java b/pgpainless-core/src/test/java/investigations/InvestigateMultiSEIPMessageHandlingTest.java index 3350203a..b3d79f50 100644 --- a/pgpainless-core/src/test/java/investigations/InvestigateMultiSEIPMessageHandlingTest.java +++ b/pgpainless-core/src/test/java/investigations/InvestigateMultiSEIPMessageHandlingTest.java @@ -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 diff --git a/pgpainless-core/src/test/java/investigations/ModifiedPublicKeysInvestigation.java b/pgpainless-core/src/test/java/investigations/ModifiedPublicKeysInvestigation.java index ba16e2d0..6eb41594 100644 --- a/pgpainless-core/src/test/java/investigations/ModifiedPublicKeysInvestigation.java +++ b/pgpainless-core/src/test/java/investigations/ModifiedPublicKeysInvestigation.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/bouncycastle/AsciiArmorCRCTests.java b/pgpainless-core/src/test/java/org/bouncycastle/AsciiArmorCRCTests.java index c3af0bd6..2fd96d6e 100644 --- a/pgpainless-core/src/test/java/org/bouncycastle/AsciiArmorCRCTests.java +++ b/pgpainless-core/src/test/java/org/bouncycastle/AsciiArmorCRCTests.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/CleartextSignatureVerificationTest.java b/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/CleartextSignatureVerificationTest.java index cabfdbb1..f7e3cebb 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/CleartextSignatureVerificationTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/CleartextSignatureVerificationTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/MissingPassphraseForDecryptionTest.java b/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/MissingPassphraseForDecryptionTest.java index f7d36aba..a00a4c68 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/MissingPassphraseForDecryptionTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/MissingPassphraseForDecryptionTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/ModificationDetectionTests.java b/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/ModificationDetectionTests.java index 2ca265ea..32c6b615 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/ModificationDetectionTests.java +++ b/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/ModificationDetectionTests.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/PostponeDecryptionUsingKeyWithMissingPassphraseTest.java b/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/PostponeDecryptionUsingKeyWithMissingPassphraseTest.java index c86a823c..7cb46d1d 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/PostponeDecryptionUsingKeyWithMissingPassphraseTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/PostponeDecryptionUsingKeyWithMissingPassphraseTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/WrongSignerUserIdTest.java b/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/WrongSignerUserIdTest.java index b3ecabc8..03a59a9a 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/WrongSignerUserIdTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/WrongSignerUserIdTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptDecryptTest.java b/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptDecryptTest.java index 88a2c38b..81672263 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptDecryptTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptDecryptTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptionOptionsTest.java b/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptionOptionsTest.java index 3e7ccb4d..a02efc41 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptionOptionsTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptionOptionsTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptionStreamClosedTest.java b/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptionStreamClosedTest.java index 4ac43630..363ad38e 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptionStreamClosedTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptionStreamClosedTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/SigningTest.java b/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/SigningTest.java index 156e6b57..e043f764 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/SigningTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/SigningTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/example/Encrypt.java b/pgpainless-core/src/test/java/org/pgpainless/example/Encrypt.java index ed57b90b..c523cb86 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/example/Encrypt.java +++ b/pgpainless-core/src/test/java/org/pgpainless/example/Encrypt.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/example/GenerateKeys.java b/pgpainless-core/src/test/java/org/pgpainless/example/GenerateKeys.java index 1e743fa1..ea30ffe1 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/example/GenerateKeys.java +++ b/pgpainless-core/src/test/java/org/pgpainless/example/GenerateKeys.java @@ -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. diff --git a/pgpainless-core/src/test/java/org/pgpainless/example/ManagePolicy.java b/pgpainless-core/src/test/java/org/pgpainless/example/ManagePolicy.java index fa2759dc..8496e775 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/example/ManagePolicy.java +++ b/pgpainless-core/src/test/java/org/pgpainless/example/ManagePolicy.java @@ -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. diff --git a/pgpainless-core/src/test/java/org/pgpainless/example/ModifyKeys.java b/pgpainless-core/src/test/java/org/pgpainless/example/ModifyKeys.java index a0785993..734793df 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/example/ModifyKeys.java +++ b/pgpainless-core/src/test/java/org/pgpainless/example/ModifyKeys.java @@ -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. diff --git a/pgpainless-core/src/test/java/org/pgpainless/example/Sign.java b/pgpainless-core/src/test/java/org/pgpainless/example/Sign.java index 06228c75..c0118077 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/example/Sign.java +++ b/pgpainless-core/src/test/java/org/pgpainless/example/Sign.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/example/UnlockSecretKeys.java b/pgpainless-core/src/test/java/org/pgpainless/example/UnlockSecretKeys.java index c6f227f3..1c24a6b6 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/example/UnlockSecretKeys.java +++ b/pgpainless-core/src/test/java/org/pgpainless/example/UnlockSecretKeys.java @@ -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. diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/TestKeys.java b/pgpainless-core/src/test/java/org/pgpainless/key/TestKeys.java index cd4c7319..d85db3d4 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/TestKeys.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/TestKeys.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/UserIdTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/UserIdTest.java index 4e596b3f..ea38b929 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/UserIdTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/UserIdTest.java @@ -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; diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/generation/BrainpoolKeyGenerationTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/generation/BrainpoolKeyGenerationTest.java index 969a0587..ddeaa113 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/generation/BrainpoolKeyGenerationTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/generation/BrainpoolKeyGenerationTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateEllipticCurveKeyTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateEllipticCurveKeyTest.java index 8ea4877d..13ccff31 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateEllipticCurveKeyTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateEllipticCurveKeyTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateKeyWithAdditionalUserIdTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateKeyWithAdditionalUserIdTest.java index b05dbe1e..3405f3b6 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateKeyWithAdditionalUserIdTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateKeyWithAdditionalUserIdTest.java @@ -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; diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateWithEmptyPassphraseTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateWithEmptyPassphraseTest.java index dbb3f49b..d3d62af8 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateWithEmptyPassphraseTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateWithEmptyPassphraseTest.java @@ -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 diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/generation/KeyGenerationSubpacketsTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/generation/KeyGenerationSubpacketsTest.java index 231b0485..b407acc9 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/generation/KeyGenerationSubpacketsTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/generation/KeyGenerationSubpacketsTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/info/KeyRingInfoTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/info/KeyRingInfoTest.java index 61e09477..5701a490 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/info/KeyRingInfoTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/info/KeyRingInfoTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/info/UserIdRevocationTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/info/UserIdRevocationTest.java index fd665901..934c6ea9 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/info/UserIdRevocationTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/info/UserIdRevocationTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/modification/AddSubKeyTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/modification/AddSubKeyTest.java index afcf9c98..e6c1d5fd 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/modification/AddSubKeyTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/modification/AddSubKeyTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/modification/AddUserIdTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/modification/AddUserIdTest.java index 19f84930..aa36afbe 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/modification/AddUserIdTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/modification/AddUserIdTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/modification/ChangeSecretKeyRingPassphraseTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/modification/ChangeSecretKeyRingPassphraseTest.java index a0ea6984..9d1ac39a 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/modification/ChangeSecretKeyRingPassphraseTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/modification/ChangeSecretKeyRingPassphraseTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/modification/GnuDummyS2KChangePassphraseTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/modification/GnuDummyS2KChangePassphraseTest.java index 64439775..bfcf08f9 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/modification/GnuDummyS2KChangePassphraseTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/modification/GnuDummyS2KChangePassphraseTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/modification/RefuseToAddWeakSubkeyTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/modification/RefuseToAddWeakSubkeyTest.java index 2570837f..2dbc5acd 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/modification/RefuseToAddWeakSubkeyTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/modification/RefuseToAddWeakSubkeyTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevocationCertificateTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevocationCertificateTest.java index ec518847..48f2e660 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevocationCertificateTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevocationCertificateTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevokeKeyWithGenericCertificationSignatureTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevokeKeyWithGenericCertificationSignatureTest.java index b2cd85fc..77a89ce0 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevokeKeyWithGenericCertificationSignatureTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevokeKeyWithGenericCertificationSignatureTest.java @@ -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; /** diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevokeSubKeyTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevokeSubKeyTest.java index 6a044199..8c5a03be 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevokeSubKeyTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevokeSubKeyTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevokeUserIdsTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevokeUserIdsTest.java index 9dc968ed..d2dc95a6 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevokeUserIdsTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/modification/RevokeUserIdsTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/parsing/KeyRingCollectionReaderTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/parsing/KeyRingCollectionReaderTest.java index 552ae25f..474edc97 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/parsing/KeyRingCollectionReaderTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/parsing/KeyRingCollectionReaderTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/parsing/KeyRingReaderTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/parsing/KeyRingReaderTest.java index 8a634200..a3261e19 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/parsing/KeyRingReaderTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/parsing/KeyRingReaderTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/protection/CachingSecretKeyRingProtectorTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/protection/CachingSecretKeyRingProtectorTest.java index d1f5f9e6..04b8def9 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/protection/CachingSecretKeyRingProtectorTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/protection/CachingSecretKeyRingProtectorTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/protection/MapBasedPassphraseProviderTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/protection/MapBasedPassphraseProviderTest.java index 3961a2be..33032d7e 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/protection/MapBasedPassphraseProviderTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/protection/MapBasedPassphraseProviderTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/protection/PassphraseProtectedKeyTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/protection/PassphraseProtectedKeyTest.java index 45aaf20f..ac52f816 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/protection/PassphraseProtectedKeyTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/protection/PassphraseProtectedKeyTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/protection/PassphraseTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/protection/PassphraseTest.java index 83477b28..2bde8636 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/protection/PassphraseTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/protection/PassphraseTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/protection/SecretKeyRingProtectorTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/protection/SecretKeyRingProtectorTest.java index a5030f74..f642ed38 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/protection/SecretKeyRingProtectorTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/protection/SecretKeyRingProtectorTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/protection/UnlockSecretKeyTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/protection/UnlockSecretKeyTest.java index c6a35ea9..f30e73a6 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/protection/UnlockSecretKeyTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/protection/UnlockSecretKeyTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/protection/fixes/S2KUsageFixTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/protection/fixes/S2KUsageFixTest.java index f324892f..eaf80418 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/protection/fixes/S2KUsageFixTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/protection/fixes/S2KUsageFixTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/util/RevocationAttributesTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/util/RevocationAttributesTest.java index 8f588a28..bf2a816c 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/util/RevocationAttributesTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/util/RevocationAttributesTest.java @@ -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; diff --git a/pgpainless-core/src/test/java/org/pgpainless/signature/subpackets/SignatureSubpacketsTest.java b/pgpainless-core/src/test/java/org/pgpainless/signature/subpackets/SignatureSubpacketsTest.java index 988bc776..ece91941 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/signature/subpackets/SignatureSubpacketsTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/signature/subpackets/SignatureSubpacketsTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/symmetric_encryption/MultiPassphraseSymmetricEncryptionTest.java b/pgpainless-core/src/test/java/org/pgpainless/symmetric_encryption/MultiPassphraseSymmetricEncryptionTest.java index 5132ef57..073b1cdd 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/symmetric_encryption/MultiPassphraseSymmetricEncryptionTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/symmetric_encryption/MultiPassphraseSymmetricEncryptionTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/symmetric_encryption/SymmetricEncryptionTest.java b/pgpainless-core/src/test/java/org/pgpainless/symmetric_encryption/SymmetricEncryptionTest.java index d3c503ab..43bb169e 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/symmetric_encryption/SymmetricEncryptionTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/symmetric_encryption/SymmetricEncryptionTest.java @@ -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. diff --git a/pgpainless-core/src/test/java/org/pgpainless/util/ArmorUtilsTest.java b/pgpainless-core/src/test/java/org/pgpainless/util/ArmorUtilsTest.java index c320c649..ec9abdea 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/util/ArmorUtilsTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/util/ArmorUtilsTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/util/ArmoredInputStreamFactoryTest.java b/pgpainless-core/src/test/java/org/pgpainless/util/ArmoredInputStreamFactoryTest.java index 147b957d..e7f8ae23 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/util/ArmoredInputStreamFactoryTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/util/ArmoredInputStreamFactoryTest.java @@ -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; diff --git a/pgpainless-core/src/test/java/org/pgpainless/util/NotationRegistryTest.java b/pgpainless-core/src/test/java/org/pgpainless/util/NotationRegistryTest.java index 3568e143..68a44495 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/util/NotationRegistryTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/util/NotationRegistryTest.java @@ -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 { diff --git a/pgpainless-core/src/test/java/org/pgpainless/util/selection/userid/SelectUserIdTest.java b/pgpainless-core/src/test/java/org/pgpainless/util/selection/userid/SelectUserIdTest.java index 3a49247c..0a57191d 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/util/selection/userid/SelectUserIdTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/util/selection/userid/SelectUserIdTest.java @@ -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; diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/ArmorImpl.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/ArmorImpl.java index 71bc3e6b..9f3b094e 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/ArmorImpl.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/ArmorImpl.java @@ -11,7 +11,7 @@ import java.io.OutputStream; import org.bouncycastle.bcpg.ArmoredOutputStream; import org.bouncycastle.util.io.Streams; -import org.pgpainless.util.ArmoredOutputStreamFactory; +import org.pgpainless.ascii_armor.ArmoredOutputStreamFactory; import sop.Ready; import sop.enums.ArmorLabel; import sop.exception.SOPGPException; diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/DecryptImpl.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/DecryptImpl.java index 4957f748..380524de 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/DecryptImpl.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/DecryptImpl.java @@ -25,7 +25,7 @@ import org.pgpainless.decryption_verification.OpenPgpMetadata; import org.pgpainless.decryption_verification.SignatureVerification; import org.pgpainless.exception.MissingDecryptionMethodException; import org.pgpainless.exception.WrongPassphraseException; -import org.pgpainless.util.Passphrase; +import org.pgpainless.s2k.Passphrase; import sop.DecryptionResult; import sop.ReadyWithResult; import sop.SessionKey; @@ -70,7 +70,7 @@ public class DecryptImpl implements Decrypt { @Override public DecryptImpl withSessionKey(SessionKey sessionKey) throws SOPGPException.UnsupportedOption { consumerOptions.setSessionKey( - new org.pgpainless.util.SessionKey( + new org.pgpainless.s2k.SessionKey( SymmetricKeyAlgorithm.requireFromId(sessionKey.getAlgorithm()), sessionKey.getKey())); return this; @@ -160,7 +160,7 @@ public class DecryptImpl implements Decrypt { SessionKey sessionKey = null; if (metadata.getSessionKey() != null) { - org.pgpainless.util.SessionKey sk = metadata.getSessionKey(); + org.pgpainless.s2k.SessionKey sk = metadata.getSessionKey(); sessionKey = new SessionKey( (byte) sk.getAlgorithm().getAlgorithmId(), sk.getKey() diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/DetachedSignImpl.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/DetachedSignImpl.java index 0ce326a9..9fe1ad86 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/DetachedSignImpl.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/DetachedSignImpl.java @@ -26,8 +26,8 @@ import org.pgpainless.encryption_signing.SigningOptions; import org.pgpainless.exception.KeyException; import org.pgpainless.key.SubkeyIdentifier; import org.pgpainless.key.info.KeyRingInfo; -import org.pgpainless.util.ArmoredOutputStreamFactory; -import org.pgpainless.util.Passphrase; +import org.pgpainless.ascii_armor.ArmoredOutputStreamFactory; +import org.pgpainless.s2k.Passphrase; import sop.MicAlg; import sop.ReadyWithResult; import sop.SigningResult; diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/EncryptImpl.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/EncryptImpl.java index 1b95d87c..51acc272 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/EncryptImpl.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/EncryptImpl.java @@ -27,7 +27,7 @@ import org.pgpainless.exception.KeyException; import org.pgpainless.exception.WrongPassphraseException; import org.pgpainless.key.OpenPgpFingerprint; import org.pgpainless.key.info.KeyRingInfo; -import org.pgpainless.util.Passphrase; +import org.pgpainless.s2k.Passphrase; import sop.Ready; import sop.enums.EncryptAs; import sop.exception.SOPGPException; diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/ExtractCertImpl.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/ExtractCertImpl.java index 5f694208..6ffed803 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/ExtractCertImpl.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/ExtractCertImpl.java @@ -15,7 +15,7 @@ import org.bouncycastle.openpgp.PGPPublicKeyRing; import org.bouncycastle.openpgp.PGPSecretKeyRing; import org.bouncycastle.openpgp.PGPSecretKeyRingCollection; import org.pgpainless.PGPainless; -import org.pgpainless.util.ArmorUtils; +import org.pgpainless.ascii_armor.ArmorUtils; import sop.Ready; import sop.exception.SOPGPException; import sop.operation.ExtractCert; diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/GenerateKeyImpl.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/GenerateKeyImpl.java index 893c8dd8..1c12b11e 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/GenerateKeyImpl.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/GenerateKeyImpl.java @@ -18,8 +18,8 @@ import org.bouncycastle.openpgp.PGPSecretKeyRing; import org.pgpainless.PGPainless; import org.pgpainless.key.modification.secretkeyring.SecretKeyRingEditorInterface; import org.pgpainless.key.protection.SecretKeyRingProtector; -import org.pgpainless.util.ArmorUtils; -import org.pgpainless.util.Passphrase; +import org.pgpainless.ascii_armor.ArmorUtils; +import org.pgpainless.s2k.Passphrase; import sop.Ready; import sop.exception.SOPGPException; import sop.operation.GenerateKey; diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineDetachImpl.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineDetachImpl.java index 178018aa..d9e583e3 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineDetachImpl.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineDetachImpl.java @@ -24,7 +24,7 @@ import org.pgpainless.decryption_verification.OpenPgpInputStream; import org.pgpainless.decryption_verification.cleartext_signatures.ClearsignedMessageUtil; import org.pgpainless.exception.WrongConsumingMethodException; import org.pgpainless.implementation.ImplementationFactory; -import org.pgpainless.util.ArmoredOutputStreamFactory; +import org.pgpainless.ascii_armor.ArmoredOutputStreamFactory; import sop.ReadyWithResult; import sop.Signatures; import sop.exception.SOPGPException; diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineSignImpl.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineSignImpl.java index 3bdc8fc3..c0553eed 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineSignImpl.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/InlineSignImpl.java @@ -23,7 +23,7 @@ import org.pgpainless.encryption_signing.SigningOptions; import org.pgpainless.exception.KeyException; import org.pgpainless.key.OpenPgpFingerprint; import org.pgpainless.key.info.KeyRingInfo; -import org.pgpainless.util.Passphrase; +import org.pgpainless.s2k.Passphrase; import sop.Ready; import sop.enums.InlineSignAs; import sop.exception.SOPGPException; diff --git a/pgpainless-sop/src/main/java/org/pgpainless/sop/MatchMakingSecretKeyRingProtector.java b/pgpainless-sop/src/main/java/org/pgpainless/sop/MatchMakingSecretKeyRingProtector.java index df54583e..fead8c43 100644 --- a/pgpainless-sop/src/main/java/org/pgpainless/sop/MatchMakingSecretKeyRingProtector.java +++ b/pgpainless-sop/src/main/java/org/pgpainless/sop/MatchMakingSecretKeyRingProtector.java @@ -18,7 +18,7 @@ import org.pgpainless.key.info.KeyInfo; 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; public class MatchMakingSecretKeyRingProtector implements SecretKeyRingProtector { diff --git a/pgpainless-sop/src/test/java/org/pgpainless/sop/ArmorTest.java b/pgpainless-sop/src/test/java/org/pgpainless/sop/ArmorTest.java index 95129dfa..a5458898 100644 --- a/pgpainless-sop/src/test/java/org/pgpainless/sop/ArmorTest.java +++ b/pgpainless-sop/src/test/java/org/pgpainless/sop/ArmorTest.java @@ -15,7 +15,7 @@ import java.security.NoSuchAlgorithmException; import org.bouncycastle.openpgp.PGPException; import org.junit.jupiter.api.Test; import org.pgpainless.PGPainless; -import org.pgpainless.util.ArmorUtils; +import org.pgpainless.ascii_armor.ArmorUtils; import sop.enums.ArmorLabel; import sop.exception.SOPGPException; diff --git a/pgpainless-sop/src/test/java/org/pgpainless/sop/IncapableKeysTest.java b/pgpainless-sop/src/test/java/org/pgpainless/sop/IncapableKeysTest.java index 5139bbf6..6c1d302d 100644 --- a/pgpainless-sop/src/test/java/org/pgpainless/sop/IncapableKeysTest.java +++ b/pgpainless-sop/src/test/java/org/pgpainless/sop/IncapableKeysTest.java @@ -14,7 +14,7 @@ import org.pgpainless.key.generation.KeySpec; import org.pgpainless.key.generation.type.KeyType; import org.pgpainless.key.generation.type.ecc.EllipticCurve; import org.pgpainless.key.generation.type.eddsa.EdDSACurve; -import org.pgpainless.util.ArmorUtils; +import org.pgpainless.ascii_armor.ArmorUtils; import sop.SOP; import sop.exception.SOPGPException;