Interface CryptoRandom

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
JavaCryptoRandom, OpenSslCryptoRandom, OpenSslJnaCryptoRandom, OsCryptoRandom

public interface CryptoRandom extends Closeable
Generates random bytes.

Note that implementations must provide a constructor that takes a Properties instance.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    nextBytes(byte[] bytes)
    Generates random bytes and places them into a user-supplied byte array.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • nextBytes

      void nextBytes(byte[] bytes)
      Generates random bytes and places them into a user-supplied byte array. The number of random bytes produced is equal to the length of the byte array.
      Parameters:
      bytes - the byte array to fill with random bytes