Creates a new instance with a default backing {@link SecureRandom SecureRandom} and a {@link #getDefaultNextBytesSize() defaultNextBytesSize} of {@code 16}, which equals 128 bits, a size commonly used in cryptographic algorithms.
Returns the size of the generated byte array for calls to {@link #nextBytes() nextBytes()}. Defaults to {@code 16}, which equals 128 bits, a size commonly used in cryptographic algorithms.
Returns the {@link SecureRandom SecureRandom} backing this instance.
Sets the size of the generated byte array for calls to {@link #nextBytes() nextBytes()}. Defaults to {@code 16}, which equals 128 bits, a size commonly used in cryptographic algorithms.
Sets the {@link SecureRandom SecureRandom} to back this instance.
Seeds the backing {@link SecureRandom SecureRandom} instance with additional seed data.
Generates a byte array of fixed length filled with random data, often useful for generating salts, initialization vectors or other seed data. The length is specified as a configuration value on the underlying implementation. <p/> If you'd like per-invocation control the number of bytes generated, use the {@link #nextBytes(int) nextBytes(int)} method instead.
Generates a byte array of the specified length filled with random data.
Default implementation of the {@link RandomNumberGenerator RandomNumberGenerator} interface, backed by a {@link SecureRandom SecureRandom} instance. <p/> This class is a little easier to use than using the JDK's {@code SecureRandom} class directly. It also allows for JavaBeans-style of customization, convenient for Shiro's INI configuration or other IoC configuration mechanism.
@since 1.1