Class FipsDRBG.Builder

  • Enclosing class:
    FipsDRBG

    public static class FipsDRBG.Builder
    extends java.lang.Object
    Builder for SecureRandom objects based on the FIPS DRBGs.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      FipsSecureRandom build​(byte[] nonce, boolean predictionResistant)
      Build a SecureRandom based on a SP 800-90A DRBG.
      FipsSecureRandom build​(byte[] nonce, boolean predictionResistant, byte[] additionalInput)
      Build a SecureRandom based on a SP 800-90A DRBG.
      FipsDRBG.Builder setEntropyBitsRequired​(int entropyBitsRequired)
      Set the amount of entropy bits required for seeding and reseeding DRBGs used in building SecureRandom objects.
      FipsDRBG.Builder setPersonalizationString​(byte[] personalizationString)
      Set the personalization string for DRBG SecureRandoms created by this builder
      FipsDRBG.Builder setSecurityStrength​(int securityStrength)
      Set the security strength required for DRBGs used in building SecureRandom objects.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setPersonalizationString

        public FipsDRBG.Builder setPersonalizationString​(byte[] personalizationString)
        Set the personalization string for DRBG SecureRandoms created by this builder
        Parameters:
        personalizationString - the personalisation string for the underlying DRBG.
        Returns:
        the current Builder instance.
      • setSecurityStrength

        public FipsDRBG.Builder setSecurityStrength​(int securityStrength)
        Set the security strength required for DRBGs used in building SecureRandom objects.
        Parameters:
        securityStrength - the security strength (in bits)
        Returns:
        the current Builder instance.
      • setEntropyBitsRequired

        public FipsDRBG.Builder setEntropyBitsRequired​(int entropyBitsRequired)
        Set the amount of entropy bits required for seeding and reseeding DRBGs used in building SecureRandom objects.
        Parameters:
        entropyBitsRequired - the number of bits of entropy to be requested from the entropy source on each seed/reseed.
        Returns:
        the current Builder instance.
      • build

        public FipsSecureRandom build​(byte[] nonce,
                                      boolean predictionResistant)
        Build a SecureRandom based on a SP 800-90A DRBG.
        Parameters:
        nonce - nonce value to use in DRBG construction.
        predictionResistant - specify whether the underlying DRBG in the resulting SecureRandom should reseed on each request for bytes.
        Returns:
        a SecureRandom supported by a DRBG.
      • build

        public FipsSecureRandom build​(byte[] nonce,
                                      boolean predictionResistant,
                                      byte[] additionalInput)
        Build a SecureRandom based on a SP 800-90A DRBG.
        Parameters:
        nonce - nonce value to use in DRBG construction.
        predictionResistant - specify whether the underlying DRBG in the resulting SecureRandom should reseed on each request for bytes.
        additionalInput - initial additional input to be used for generating the initial continuous health check block by the DRBG.
        Returns:
        a SecureRandom supported by a DRBG.