Class Crypto

java.lang.Object
org.apache.commons.crypto.Crypto

public final class Crypto extends Object
Provides diagnostic information about Commons Crypto and keys for native class loading.
  • Field Details

    • CONF_PREFIX

      public static final String CONF_PREFIX
      The prefix of all crypto configuration keys.
      See Also:
    • LIB_NAME_KEY

      public static final String LIB_NAME_KEY
      The configuration key of the file name for loading crypto library.
      See Also:
    • LIB_PATH_KEY

      public static final String LIB_PATH_KEY
      The configuration key of the path for loading crypto library.
      See Also:
    • LIB_TEMPDIR_KEY

      public static final String 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

      public static String 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

      public static String 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

      public static Throwable getLoadingError()
      The loading error throwable, if loading failed.
      Returns:
      null, unless loading failed.
    • info

      private static void info(String format, Object... args)
      Logs info-level messages.
      Parameters:
      format - See String.format(String, Object...).
      args - See String.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

      public static void main(String[] args) throws Exception
      The Main of Crypto.
      Parameters:
      args - Not used.
      Throws:
      Exception - if getCryptoRandom or getCryptoCipher get error.