Returns a SecureRandom object that implements the specified Random Number Generator (RNG) algorithm.
This method traverses the list of registered security Providers, starting with the most preferred Provider. A new SecureRandom object encapsulating the SecureRandomSpi implementation from the first Provider that supports the specified algorithm is returned.
Note that the list of registered providers may be retrieved via
the Security.getProviders() method.
The returned SecureRandom object has not been seeded. To seed the
returned object, call the setSeed method.
If setSeed is not called, the first call to
nextBytes will force the SecureRandom object to seed itself.
This self-seeding will not occur if setSeed was
previously called.
algorithm | the name of the RNG algorithm. See the SecureRandom section in the Java Cryptography Architecture Standard Algorithm Name Documentation for information about standard RNG algorithm names. |
NoSuchAlgorithmException | if no Provider supports a SecureRandomSpi implementation for the specified algorithm. |
Provider
Diagram: Random