Top Description Fields Constructors Methods
org.conscrypt

public final Class OpenSSLRandom

extends SecureRandomSpi
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Annotations
@Internal
Imports
java.io.Serializable, java.security.SecureRandomSpi

Implements java.security.SecureRandom using BoringSSL's RAND interface.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected byte[]
engineGenerateSeed(int
the number of seed bytes to generate.
numBytes
)

Implements abstract java.security.SecureRandomSpi.engineGenerateSeed.

Returns the given number of seed bytes.
protected void
engineNextBytes(byte[]
the array to be filled in with random bytes.
bytes
)

Implements abstract java.security.SecureRandomSpi.engineNextBytes.

Generates a user-specified number of random bytes.
protected void
engineSetSeed(byte[]
the seed.
seed
)

Implements abstract java.security.SecureRandomSpi.engineSetSeed.

Reseeds this random object with the given seed.
Inherited from java.security.SecureRandomSpi:
engineGetParametersengineNextBytesengineReseedtoString

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.security.SecureRandomSpi.serialVersionUID.

Constructor Detail

OpenSSLRandomback to summary
public OpenSSLRandom()

Method Detail

engineGenerateSeedback to summary
protected byte[] engineGenerateSeed(int numBytes)

Implements abstract java.security.SecureRandomSpi.engineGenerateSeed.

Doc from java.security.SecureRandomSpi.engineGenerateSeed.

Returns the given number of seed bytes. This call may be used to seed other random number generators.

Parameters
numBytes:int

the number of seed bytes to generate.

Returns:byte[]

the seed bytes.

Annotations
@Override
engineNextBytesback to summary
protected void engineNextBytes(byte[] bytes)

Implements abstract java.security.SecureRandomSpi.engineNextBytes.

Doc from java.security.SecureRandomSpi.engineNextBytes.

Generates a user-specified number of random bytes.

Some random number generators can only generate a limited amount of random bytes per invocation. If the size of bytes is greater than this limit, the implementation should invoke its generation process multiple times to completely fill the buffer before returning from this method.

Parameters
bytes:byte[]

the array to be filled in with random bytes.

Annotations
@Override
engineSetSeedback to summary
protected void engineSetSeed(byte[] seed)

Implements abstract java.security.SecureRandomSpi.engineSetSeed.

Doc from java.security.SecureRandomSpi.engineSetSeed.

Reseeds this random object with the given seed. The seed supplements, rather than replaces, the existing seed. Thus, repeated calls are guaranteed never to reduce randomness.

Parameters
seed:byte[]

the seed.

Annotations
@Override