Repository: commons-crypto Updated Branches: refs/heads/master 7de465601 -> 6522a7299
getCipherClassString is only used by CryptoCipherFactory Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/6522a729 Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/6522a729 Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/6522a729 Branch: refs/heads/master Commit: 6522a729904d5c657f07963654ee0cd5eba3ba5a Parents: 7de4656 Author: Sebb <[email protected]> Authored: Fri Jun 24 15:06:31 2016 +0100 Committer: Sebb <[email protected]> Committed: Fri Jun 24 15:06:31 2016 +0100 ---------------------------------------------------------------------- .../crypto/cipher/CryptoCipherFactory.java | 23 ++++++++++++++++++-- .../org/apache/commons/crypto/utils/Utils.java | 19 ---------------- 2 files changed, 21 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/6522a729/src/main/java/org/apache/commons/crypto/cipher/CryptoCipherFactory.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/cipher/CryptoCipherFactory.java b/src/main/java/org/apache/commons/crypto/cipher/CryptoCipherFactory.java index ac7bb68..cb17169 100644 --- a/src/main/java/org/apache/commons/crypto/cipher/CryptoCipherFactory.java +++ b/src/main/java/org/apache/commons/crypto/cipher/CryptoCipherFactory.java @@ -21,6 +21,7 @@ import java.security.GeneralSecurityException; import java.util.List; import java.util.Properties; +import org.apache.commons.crypto.conf.ConfigurationKeys; import org.apache.commons.crypto.utils.ReflectionUtils; import org.apache.commons.crypto.utils.Utils; @@ -47,8 +48,7 @@ public class CryptoCipherFactory { public static CryptoCipher getInstance(String transformation, Properties props) throws GeneralSecurityException { - List<String> klasses = Utils.splitClassNames( - Utils.getCipherClassString(props), ","); + List<String> klasses = Utils.splitClassNames(getCipherClassString(props), ","); CryptoCipher cipher = null; StringBuilder errorMessage = new StringBuilder("CryptoCipher "); @@ -95,4 +95,23 @@ public class CryptoCipherFactory { return getInstance(transformation, new Properties()); } + /** + * Gets the cipher class. + * + * @param props The <code>Properties</code> class represents a set of + * properties. + * @return the cipher class based on the props. + */ + private static String getCipherClassString(Properties props) { + final String configName = ConfigurationKeys.CIPHER_CLASSES_KEY; + String cipherClassString = props.getProperty(configName) != null ? props + .getProperty(configName, ConfigurationKeys.CIPHER_CLASSES_DEFAULT) + : System.getProperty(configName, + ConfigurationKeys.CIPHER_CLASSES_DEFAULT); + if (cipherClassString.isEmpty()) { + cipherClassString = ConfigurationKeys.CIPHER_CLASSES_DEFAULT; + } + return cipherClassString; + } + } http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/6522a729/src/main/java/org/apache/commons/crypto/utils/Utils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/utils/Utils.java b/src/main/java/org/apache/commons/crypto/utils/Utils.java index 79045bd..fd5cf9f 100644 --- a/src/main/java/org/apache/commons/crypto/utils/Utils.java +++ b/src/main/java/org/apache/commons/crypto/utils/Utils.java @@ -137,25 +137,6 @@ public final class Utils { } /** - * Gets the cipher class. - * - * @param props The <code>Properties</code> class represents a set of - * properties. - * @return the cipher class based on the props. - */ - public static String getCipherClassString(Properties props) { - final String configName = ConfigurationKeys.CIPHER_CLASSES_KEY; - String cipherClassString = props.getProperty(configName) != null ? props - .getProperty(configName, ConfigurationKeys.CIPHER_CLASSES_DEFAULT) - : System.getProperty(configName, - ConfigurationKeys.CIPHER_CLASSES_DEFAULT); - if (cipherClassString.isEmpty()) { - cipherClassString = ConfigurationKeys.CIPHER_CLASSES_DEFAULT; - } - return cipherClassString; - } - - /** * Gets path of native library. * * @return the path of native library.
