Package org.apache.commons.crypto.cipher
Enum CryptoCipherFactory.CipherProvider
- java.lang.Object
-
- java.lang.Enum<CryptoCipherFactory.CipherProvider>
-
- org.apache.commons.crypto.cipher.CryptoCipherFactory.CipherProvider
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<CryptoCipherFactory.CipherProvider>
- Enclosing class:
- CryptoCipherFactory
public static enum CryptoCipherFactory.CipherProvider extends java.lang.Enum<CryptoCipherFactory.CipherProvider>
Defines the internal CryptoCipher implementations.Usage:
props.setProperty(CryptoCipherFactory.CLASSES_KEY, CipherProvider.OPENSSL.getClassName()); props.setProperty(...); // if required by the implementation cipher = CryptoCipherFactory.getInstance(transformation, props);
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
className
private java.lang.Class<? extends CryptoCipher>
klass
-
Constructor Summary
Constructors Modifier Constructor Description private
CipherProvider(java.lang.Class<? extends CryptoCipher> klass)
The private constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getClassName()
Gets the class name of the provider.java.lang.Class<? extends CryptoCipher>
getImplClass()
Gets the implementation class of the provider.static CryptoCipherFactory.CipherProvider
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static CryptoCipherFactory.CipherProvider[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
OPENSSL
public static final CryptoCipherFactory.CipherProvider OPENSSL
The OpenSSL cipher implementation (using JNI)This implementation does not use any properties
-
JCE
public static final CryptoCipherFactory.CipherProvider JCE
The JCE cipher implementation from the JVMuses the property
CryptoCipherFactory.JCE_PROVIDER_KEY
to define the provider name, if present.
-
-
Field Detail
-
klass
private final java.lang.Class<? extends CryptoCipher> klass
-
className
private final java.lang.String className
-
-
Constructor Detail
-
CipherProvider
private CipherProvider(java.lang.Class<? extends CryptoCipher> klass)
The private constructor.- Parameters:
klass
- the Class of CryptoCipher
-
-
Method Detail
-
values
public static CryptoCipherFactory.CipherProvider[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CryptoCipherFactory.CipherProvider c : CryptoCipherFactory.CipherProvider.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CryptoCipherFactory.CipherProvider valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getClassName
public java.lang.String getClassName()
Gets the class name of the provider.- Returns:
- the fully qualified name of the provider class
-
getImplClass
public java.lang.Class<? extends CryptoCipher> getImplClass()
Gets the implementation class of the provider.- Returns:
- the implementation class of the provider
-
-