Enum CryptoRandomFactory.RandomProvider

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<CryptoRandomFactory.RandomProvider>
    Enclosing class:
    CryptoRandomFactory

    public static enum CryptoRandomFactory.RandomProvider
    extends java.lang.Enum<CryptoRandomFactory.RandomProvider>
    Defines the internal CryptoRandom implementations.

    Usage:

     props.setProperty(CryptoRandomFactory.CLASSES_KEY, RandomProvider.OPENSSL.getClassName());
     props.setProperty(...); // if required by the implementation
     random = CryptoRandomFactory.getCryptoRandom(transformation, props);
     
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      JAVA
      The SecureRandom implementation from the JVM
      OPENSSL
      The OpenSSL Random implementation (using JNI)
      OS
      The OS random device implementation.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String className  
      private java.lang.Class<? extends CryptoRandom> klass  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private RandomProvider​(java.lang.Class<? extends CryptoRandom> klass)
      The private constructor.
    • Field Detail

      • klass

        private final java.lang.Class<? extends CryptoRandom> klass
      • className

        private final java.lang.String className
    • Constructor Detail

      • RandomProvider

        private RandomProvider​(java.lang.Class<? extends CryptoRandom> klass)
        The private constructor.
        Parameters:
        klass - the Class of CryptoRandom
    • Method Detail

      • values

        public static CryptoRandomFactory.RandomProvider[] 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 (CryptoRandomFactory.RandomProvider c : CryptoRandomFactory.RandomProvider.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CryptoRandomFactory.RandomProvider 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 name
        java.lang.NullPointerException - if the argument is null
      • getClassName

        public java.lang.String getClassName()
        Gets the class name of the provider.
        Returns:
        the name of the provider class
      • getImplClass

        public java.lang.Class<? extends CryptoRandom> getImplClass()
        Gets the implementation class of the provider.
        Returns:
        the implementation class of the provider