Class X931PRNG.Builder

  • Enclosing class:
    X931PRNG

    public static class X931PRNG.Builder
    extends java.lang.Object
    Builder for SecureRandom objects based on the X9.31 PRNG.
    • Method Detail

      • setDateTimeVector

        public X931PRNG.Builder setDateTimeVector​(byte[] dateTimeVector)
        Set the dateTime vector to be used with the generator. If this method is not called a vector is calculated based on System.currentTimeMillis().
        Parameters:
        dateTimeVector - a dateTime vector - needs to be the same size as the block size of the cipher.
        Returns:
        the current Builder instance.
      • build

        public GeneralSecureRandom build​(SymmetricKey key,
                                         boolean predictionResistant)
        Construct a X9.31 secure random generator using the passed in engine and key. If predictionResistant is true the generator will be reseeded on each request.
        Parameters:
        key - the block cipher key to initialise algorithm implementation with.
        predictionResistant - true if engine to be reseeded on each use, false otherwise.
        Returns:
        a SecureRandom.