java.lang.Object | ||
↳ | java.util.Random | |
↳ | java.security.SecureRandom |
SecureRandom
is an engine class which is capable of generating
cryptographically secure pseudo-random numbers.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new instance of
SecureRandom . | |||||||||||
Constructs a new instance of
SecureRandom . |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new instance of
SecureRandom using the given
implementation from the specified provider. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Generates and returns the specified number of seed bytes, computed using
the seed generation algorithm used by this
SecureRandom . | |||||||||||
Returns the name of the algorithm of this
SecureRandom . | |||||||||||
Returns a new instance of
SecureRandom that utilizes the
specified algorithm from the specified provider. | |||||||||||
Returns a new instance of
SecureRandom that utilizes the
specified algorithm from the specified provider. | |||||||||||
Returns a new instance of
SecureRandom that utilizes the
specified algorithm. | |||||||||||
Returns the provider associated with this
SecureRandom . | |||||||||||
Generates and returns the specified number of seed bytes, computed using
the seed generation algorithm used by this
SecureRandom . | |||||||||||
Generates and stores random bytes in the given
byte[] for each
array element. | |||||||||||
Reseeds this
SecureRandom instance with the specified seed . | |||||||||||
Reseeds this this
SecureRandom instance with the eight bytes
described by the representation of the given long seed . |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Generates and returns an
int containing the specified number of
random bits (right justified, with leading zeros). |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.util.Random
| |||||||||||
From class java.lang.Object
|
Constructs a new instance of SecureRandom
. An implementation for
the highest-priority provider is returned. The constructed instance will
not have been seeded.
Constructs a new instance of SecureRandom
. An implementation for
the highest-priority provider is returned. The constructed instance will
be seeded with the parameter.
seed | the seed for this generator. |
---|
Constructs a new instance of SecureRandom
using the given
implementation from the specified provider.
secureRandomSpi | the implementation. |
---|---|
provider | the security provider. |
Generates and returns the specified number of seed bytes, computed using
the seed generation algorithm used by this SecureRandom
.
numBytes | the number of seed bytes. |
---|
Returns the name of the algorithm of this SecureRandom
.
SecureRandom
.Returns a new instance of SecureRandom
that utilizes the
specified algorithm from the specified provider.
algorithm | the name of the algorithm to use. |
---|---|
provider | the name of the provider. |
SecureRandom
that utilizes the
specified algorithm from the specified provider.NoSuchAlgorithmException | if the specified algorithm is not available. |
---|---|
NoSuchProviderException | if the specified provider is not available. |
NullPointerException | if algorithm is null . |
Returns a new instance of SecureRandom
that utilizes the
specified algorithm from the specified provider.
algorithm | the name of the algorithm to use. |
---|---|
provider | the security provider. |
SecureRandom
that utilizes the
specified algorithm from the specified provider.NoSuchAlgorithmException | if the specified algorithm is not available. |
---|---|
NullPointerException | if algorithm is null . |
Returns a new instance of SecureRandom
that utilizes the
specified algorithm.
algorithm | the name of the algorithm to use. |
---|
SecureRandom
that utilizes the
specified algorithm.NoSuchAlgorithmException | if the specified algorithm is not available. |
---|---|
NullPointerException | if algorithm is null . |
Returns the provider associated with this SecureRandom
.
SecureRandom
.Generates and returns the specified number of seed bytes, computed using
the seed generation algorithm used by this SecureRandom
.
numBytes | the number of seed bytes. |
---|
Generates and stores random bytes in the given byte[]
for each
array element.
bytes | the byte[] to be filled with random bytes. |
---|
Reseeds this SecureRandom
instance with the specified seed
. The seed of this SecureRandom
instance is supplemented,
not replaced.
seed | the new seed. |
---|
Reseeds this this SecureRandom
instance with the eight bytes
described by the representation of the given long seed
. The seed
of this SecureRandom
instance is supplemented, not replaced.
seed | the new seed. |
---|
Generates and returns an int
containing the specified number of
random bits (right justified, with leading zeros).
numBits | number of bits to be generated. An input value should be in the range [0, 32]. |
---|
int
containing the specified number of random bits.