Class SecureRandomBuilder


  • public final class SecureRandomBuilder
    extends java.lang.Object
    The class SecureRandomBuilder builds a SecureRandom from the given algorithm and provider. If nothing is set the default SecureRandom object with the default algorithm will be build.
    • Field Detail

      • DEFAULT_ALGORITHM

        public static final java.lang.String DEFAULT_ALGORITHM
        The Constant DEFAULT_ALGORITHM
        See Also:
        Constant Field Values
    • Method Detail

      • getInstance

        public static SecureRandomBuilder getInstance​(java.lang.String algorithm,
                                                      java.lang.String provider)
        Gets an instance of SecureRandomBuilder from the given algorithm and provider
        Parameters:
        algorithm - the algorithm
        provider - the provider
        Returns:
        the new SecureRandomBuilder object
      • getInstance

        public static SecureRandomBuilder getInstance​(java.lang.String algorithm,
                                                      java.lang.String provider,
                                                      long seed)
        Gets an instance of SecureRandomBuilder from the given algorithm and provider
        Parameters:
        algorithm - the algorithm
        provider - the provider
        seed - the seed
        Returns:
        the new SecureRandomBuilder object
      • getInstance

        public static SecureRandomBuilder getInstance​(java.lang.String algorithm,
                                                      java.lang.String provider,
                                                      java.util.Date seed)
        Gets an instance of SecureRandomBuilder from the given algorithm and provider
        Parameters:
        algorithm - the algorithm
        provider - the provider
        seed - the seed as Date object
        Returns:
        the new SecureRandomBuilder object
      • algorithm

        public SecureRandomBuilder algorithm​(java.lang.String algorithm)
        Sets the algorithm.
        Parameters:
        algorithm - the algorithm
        Returns:
        this SecureRandomBuilder object. For chaining.
      • build

        public java.security.SecureRandom build()
        Builds a SecureRandom from the given algorithm and provider. If nothing is set the default SecureRandom object with the default algorithm will be build.
        Returns:
        the new SecureRandom object
      • provider

        public SecureRandomBuilder provider​(java.lang.String provider)
        Sets the provider.
        Parameters:
        provider - the provider
        Returns:
        this SecureRandomBuilder object. For chaining.