From 71e0886916871a6baf3151460f288a7b777693fd Mon Sep 17 00:00:00 2001 From: Ivan Pizhenko Date: Tue, 27 Apr 2021 09:22:06 +0300 Subject: [PATCH] better method names --- .../src/main/java/org/pgpainless/key/info/KeyInfo.java | 6 +++--- .../src/main/java/org/pgpainless/key/info/KeyRingInfo.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyInfo.java b/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyInfo.java index 01f93d0b..0306ef26 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyInfo.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyInfo.java @@ -69,8 +69,8 @@ public class KeyInfo { * @return true if secret key has S2K of a type GNU_DUMMY_S2K, false if there is public key only, * or S2K on the secret key is absent or not of a type GNU_DUMMY_S2K. */ - public boolean hasGnuDummyS2K() { - return secretKey != null && hasGnuDummyS2K(secretKey); + public boolean hasDummyS2K() { + return secretKey != null && hasDummyS2K(secretKey); } public static String getCurveName(PGPPublicKey publicKey) { @@ -125,7 +125,7 @@ public class KeyInfo { * @param secretKey A secret key to examine. * @return true if secret key has S2K of a type GNU_DUMMY_S2K, false otherwise. */ - public static boolean hasGnuDummyS2K(PGPSecretKey secretKey) { + public static boolean hasDummyS2K(PGPSecretKey secretKey) { final S2K s2k = secretKey.getS2K(); return s2k != null && s2k.getType() == S2K.GNU_DUMMY_S2K; } 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 3788d5af..6869796d 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 @@ -308,7 +308,7 @@ public class KeyRingInfo { public boolean isFullyDecrypted() { if (isSecretKey()) { for (PGPSecretKey secretKey : getSecretKeys()) { - if (!KeyInfo.hasGnuDummyS2K(secretKey) && KeyInfo.isEncrypted(secretKey)) { + if (!KeyInfo.hasDummyS2K(secretKey) && KeyInfo.isEncrypted(secretKey)) { return false; } } @@ -327,7 +327,7 @@ public class KeyRingInfo { public boolean isFullyEncrypted() { if (isSecretKey()) { for (PGPSecretKey secretKey : getSecretKeys()) { - if (!KeyInfo.hasGnuDummyS2K(secretKey) && KeyInfo.isDecrypted(secretKey)) { + if (!KeyInfo.hasDummyS2K(secretKey) && KeyInfo.isDecrypted(secretKey)) { return false; } }