Package org.apache.commons.crypto
Class Crypto
java.lang.Object
org.apache.commons.crypto.Crypto
Provides diagnostic information about Commons Crypto and keys for native
class loading.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The prefix of all crypto configuration keys.static final String
The configuration key of the file name for loading crypto library.static final String
The configuration key of the path for loading crypto library.static final String
The configuration key of temp directory for extracting crypto library.private static boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Gets the component version of Apache Commons Crypto.static String
Gets the component version of Apache Commons Crypto.static Throwable
The loading error throwable, if loading failed.private static void
Logs info-level messages.static boolean
Checks whether the native code has been successfully loaded for the platform.static void
The Main of Crypto.
-
Field Details
-
CONF_PREFIX
The prefix of all crypto configuration keys.- See Also:
-
LIB_NAME_KEY
The configuration key of the file name for loading crypto library.- See Also:
-
LIB_PATH_KEY
The configuration key of the path for loading crypto library.- See Also:
-
LIB_TEMPDIR_KEY
The configuration key of temp directory for extracting crypto library. Defaults to "java.io.tempdir" if not found.- See Also:
-
quiet
private static boolean quiet
-
-
Constructor Details
-
Crypto
public Crypto()
-
-
Method Details
-
getComponentName
Gets the component version of Apache Commons Crypto.This implementation relies on the VERSION properties file which must be set up with the correct contents by the build process. This is done automatically by Maven.
- Returns:
- the version; may be null if not found
-
getComponentVersion
Gets the component version of Apache Commons Crypto.This implementation relies on the VERSION properties file which must be set up with the correct contents by the build process. This is done automatically by Maven.
- Returns:
- the version; may be null if not found
-
getLoadingError
The loading error throwable, if loading failed.- Returns:
- null, unless loading failed.
-
info
Logs info-level messages.- Parameters:
format
- SeeString.format(String, Object...)
.args
- SeeString.format(String, Object...)
.
-
isNativeCodeLoaded
public static boolean isNativeCodeLoaded()Checks whether the native code has been successfully loaded for the platform.- Returns:
- true if the native code has been loaded successfully.
-
main
The Main of Crypto.- Parameters:
args
- Not used.- Throws:
Exception
- if getCryptoRandom or getCryptoCipher get error.
-