Repository: commons-crypto Updated Branches: refs/heads/master 925d5cac8 -> b5e7b1b44
Javadoc tweaks Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/b5e7b1b4 Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/b5e7b1b4 Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/b5e7b1b4 Branch: refs/heads/master Commit: b5e7b1b44ede8156b635726a1178e5d280e750f7 Parents: 925d5ca Author: Sebb <[email protected]> Authored: Thu Jun 30 20:33:04 2016 +0100 Committer: Sebb <[email protected]> Committed: Thu Jun 30 20:33:04 2016 +0100 ---------------------------------------------------------------------- .../crypto/cipher/CryptoCipherFactory.java | 21 +++++++++----------- .../crypto/random/CryptoRandomFactory.java | 18 ++++++++--------- 2 files changed, 17 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/b5e7b1b4/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 12aa797..6c19101 100644 --- a/src/main/java/org/apache/commons/crypto/cipher/CryptoCipherFactory.java +++ b/src/main/java/org/apache/commons/crypto/cipher/CryptoCipherFactory.java @@ -25,7 +25,7 @@ import org.apache.commons.crypto.utils.ReflectionUtils; import org.apache.commons.crypto.utils.Utils; /** - * This is the factory class used for creating cipher class + * This is the factory class used for creating {@link CryptoCipher} instances. */ public class CryptoCipherFactory { @@ -34,11 +34,11 @@ public class CryptoCipherFactory { * <p> * Usage: * <p> - * <code> + * <blockquote><pre> * props.setProperty(CIPHER_CLASSES_KEY, CipherProvider.OPENSSL.getClassName()); * props.setProperty(...); // if required by the implementation * cipher = CryptoCipherFactory.getInstance(transformation, props); - * </code> + * </pre></blockquote> */ public enum CipherProvider { @@ -47,25 +47,22 @@ public class CryptoCipherFactory { * <p> * This implementation does not use any properties */ + // Please ensure the property description agrees with the implementation OPENSSL(OpenSslCipher.class), /** * The JCE cipher implementation from the JVM * <p> - * uses {@link ConfigurationKeys#CIPHER_JCE_PROVIDER_KEY}) as the provider name. - * This is optional + * uses the property {@link ConfigurationKeys#CIPHER_JCE_PROVIDER_KEY} + * to define the provider name, if present. */ + // Please ensure the property description agrees with the implementation JCE(JceCipher.class); private final Class<? extends CryptoCipher> klass; private final String className; - /** - * Constructs a CihpherProvider. - * - * @param klass the implementation of provider - */ private CipherProvider(Class<? extends CryptoCipher> klass) { this.klass = klass; this.className = klass.getName(); @@ -74,7 +71,7 @@ public class CryptoCipherFactory { /** * Gets the class name of the provider. * - * @return the name of the provider class + * @return the fully qualified name of the provider class */ public String getClassName() { return className; @@ -91,7 +88,7 @@ public class CryptoCipherFactory { } /** - * The default value (OpenSslCipher,JceCipher) for crypto cipher. + * The default value (OPENSSL,JCE) for crypto cipher. */ private static final String CIPHER_CLASSES_DEFAULT = CipherProvider.OPENSSL.getClassName() http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/b5e7b1b4/src/main/java/org/apache/commons/crypto/random/CryptoRandomFactory.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/random/CryptoRandomFactory.java b/src/main/java/org/apache/commons/crypto/random/CryptoRandomFactory.java index 5490830..4f3ca0c 100644 --- a/src/main/java/org/apache/commons/crypto/random/CryptoRandomFactory.java +++ b/src/main/java/org/apache/commons/crypto/random/CryptoRandomFactory.java @@ -25,7 +25,7 @@ import org.apache.commons.crypto.utils.ReflectionUtils; import org.apache.commons.crypto.utils.Utils; /** - * This is the factory class used for {@link CryptoRandom}. + * This is the factory class used for creating {@link CryptoRandom} instances */ public class CryptoRandomFactory { @@ -34,11 +34,11 @@ public class CryptoRandomFactory { * <p> * Usage: * <p> - * <code> + * <blockquote><pre> * props.setProperty(RANDOM_CLASSES_KEY, RandomProvider.OPENSSL.getClassName()); * props.setProperty(...); // if required by the implementation * random = CryptoRandomFactory.getCryptoRandom(transformation, props); - * </code> + * </pre></blockquote> */ public enum RandomProvider { @@ -46,8 +46,9 @@ public class CryptoRandomFactory { * The OpenSSL Random implementation (using JNI) * <p> * No properties are used for configuration, but they - * are passed to the JCE backup implementation (q.v.) + * are passed to the {@link RandomProvider#JAVA} backup implementation */ + // Please ensure the property description agrees with the implementation OPENSSL(OpenSslCryptoRandom.class), /** @@ -58,26 +59,23 @@ public class CryptoRandomFactory { * with the default of * {@link ConfigurationKeys#SECURE_RANDOM_JAVA_ALGORITHM_DEFAULT SECURE_RANDOM_JAVA_ALGORITHM_DEFAULT} */ + // Please ensure the property description agrees with the implementation JAVA(JavaCryptoRandom.class), /** - * The OS random device implementation + * The OS random device implementation. May not be available on some OSes. * <p> * Uses {@link ConfigurationKeys#SECURE_RANDOM_DEVICE_FILE_PATH_KEY} to determine the * path to the random device, default is * {@link ConfigurationKeys#SECURE_RANDOM_DEVICE_FILE_PATH_DEFAULT} */ + // Please ensure the property description agrees with the implementation OS(OsCryptoRandom.class); private final Class<? extends CryptoRandom> klass; private final String className; - /** - * Constructs a RandomProvider. - * - * @param klass the implementation of provider - */ private RandomProvider(Class<? extends CryptoRandom> klass) { this.klass = klass; this.className = klass.getName();
