Package org.conscrypt

Class OpenSSLRandom

    • Constructor Detail

      • OpenSSLRandom

        public OpenSSLRandom()
    • Method Detail

      • engineSetSeed

        protected void engineSetSeed​(byte[] seed)
        Description copied from class: SecureRandomSpi
        Reseeds this SecureRandomSpi instance with the specified seed. The seed of this SecureRandomSpi instance is supplemented, not replaced.
        Specified by:
        engineSetSeed in class SecureRandomSpi
        Parameters:
        seed - the new seed.
      • engineNextBytes

        protected void engineNextBytes​(byte[] bytes)
        Description copied from class: SecureRandomSpi
        Generates and stores random bytes in the given byte[] for each array element.
        Specified by:
        engineNextBytes in class SecureRandomSpi
        Parameters:
        bytes - the byte[] to be filled with random bytes.
      • engineGenerateSeed

        protected byte[] engineGenerateSeed​(int numBytes)
        Description copied from class: SecureRandomSpi
        Generates and returns the specified number of seed bytes, computed using the seed generation algorithm used by this SecureRandomSpi.
        Specified by:
        engineGenerateSeed in class SecureRandomSpi
        Parameters:
        numBytes - the number of seed bytes.
        Returns:
        the seed bytes
      • seedOpenSSLPRNGFromLinuxRNG

        public static void seedOpenSSLPRNGFromLinuxRNG()
        Obtains a seed from the Linux RNG and mixes it into the OpenSSL PRNG (default RAND engine).

        NOTE: This modifies the OpenSSL PRNG shared by all instances of OpenSSLRandom and other crypto primitives offered by or built on top of OpenSSL.