From e9958bc62063be242f6731f88cf4ea0cc3fe01c0 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 3 Aug 2018 12:28:25 +0200 Subject: [PATCH] Move And + Or selection strategies to util --- .../encryption_signing/EncryptionBuilder.java | 2 +- .../key/selection/key/{impl => util}/And.java | 2 +- .../key/selection/key/{impl => util}/Or.java | 2 +- .../key/selection/key/util/package-info.java | 19 +++++++++++++++++++ .../main/java/org/pgpainless/util/BCUtil.java | 2 +- 5 files changed, 23 insertions(+), 4 deletions(-) rename pgpainless-core/src/main/java/org/pgpainless/key/selection/key/{impl => util}/And.java (97%) rename pgpainless-core/src/main/java/org/pgpainless/key/selection/key/{impl => util}/Or.java (97%) create mode 100644 pgpainless-core/src/main/java/org/pgpainless/key/selection/key/util/package-info.java diff --git a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionBuilder.java b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionBuilder.java index ae5665c0..58b3417b 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionBuilder.java +++ b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionBuilder.java @@ -36,7 +36,7 @@ import org.pgpainless.algorithm.SymmetricKeyAlgorithm; import org.pgpainless.key.protection.SecretKeyRingProtector; import org.pgpainless.key.selection.key.PublicKeySelectionStrategy; import org.pgpainless.key.selection.key.SecretKeySelectionStrategy; -import org.pgpainless.key.selection.key.impl.And; +import org.pgpainless.key.selection.key.util.And; import org.pgpainless.key.selection.key.impl.EncryptionKeySelectionStrategy; import org.pgpainless.key.selection.key.impl.NoRevocation; import org.pgpainless.key.selection.key.impl.SignatureKeySelectionStrategy; diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/selection/key/impl/And.java b/pgpainless-core/src/main/java/org/pgpainless/key/selection/key/util/And.java similarity index 97% rename from pgpainless-core/src/main/java/org/pgpainless/key/selection/key/impl/And.java rename to pgpainless-core/src/main/java/org/pgpainless/key/selection/key/util/And.java index 662deaa3..c494efcd 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/selection/key/impl/And.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/selection/key/util/And.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.pgpainless.key.selection.key.impl; +package org.pgpainless.key.selection.key.util; import javax.annotation.Nonnull; diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/selection/key/impl/Or.java b/pgpainless-core/src/main/java/org/pgpainless/key/selection/key/util/Or.java similarity index 97% rename from pgpainless-core/src/main/java/org/pgpainless/key/selection/key/impl/Or.java rename to pgpainless-core/src/main/java/org/pgpainless/key/selection/key/util/Or.java index 55e263e3..a7b73208 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/selection/key/impl/Or.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/selection/key/util/Or.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.pgpainless.key.selection.key.impl; +package org.pgpainless.key.selection.key.util; import javax.annotation.Nonnull; diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/selection/key/util/package-info.java b/pgpainless-core/src/main/java/org/pgpainless/key/selection/key/util/package-info.java new file mode 100644 index 00000000..789d002b --- /dev/null +++ b/pgpainless-core/src/main/java/org/pgpainless/key/selection/key/util/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2018 Paul Schaub. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Implementations of utility Key Selection Strategies. + */ +package org.pgpainless.key.selection.key.util; diff --git a/pgpainless-core/src/main/java/org/pgpainless/util/BCUtil.java b/pgpainless-core/src/main/java/org/pgpainless/util/BCUtil.java index a022bfcc..bacb199c 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/util/BCUtil.java +++ b/pgpainless-core/src/main/java/org/pgpainless/util/BCUtil.java @@ -42,7 +42,7 @@ import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator; import org.bouncycastle.util.io.Streams; import org.pgpainless.algorithm.KeyFlag; import org.pgpainless.key.selection.key.PublicKeySelectionStrategy; -import org.pgpainless.key.selection.key.impl.And; +import org.pgpainless.key.selection.key.util.And; import org.pgpainless.key.selection.key.impl.NoRevocation; import org.pgpainless.key.selection.key.impl.SignedByMasterKey;