< prev index next >

src/java.base/share/classes/java/security/SecureRandom.java

Print this page




 253      * Random Number Generator (RNG) algorithm.
 254      *
 255      * <p> This method traverses the list of registered security Providers,
 256      * starting with the most preferred Provider.
 257      * A new SecureRandom object encapsulating the
 258      * SecureRandomSpi implementation from the first
 259      * Provider that supports the specified algorithm is returned.
 260      *
 261      * <p> Note that the list of registered providers may be retrieved via
 262      * the {@link Security#getProviders() Security.getProviders()} method.
 263      *
 264      * <p> The returned SecureRandom object has not been seeded.  To seed the
 265      * returned object, call the {@code setSeed} method.
 266      * If {@code setSeed} is not called, the first call to
 267      * {@code nextBytes} will force the SecureRandom object to seed itself.
 268      * This self-seeding will not occur if {@code setSeed} was
 269      * previously called.
 270      *
 271      * @implNote
 272      * The JDK Reference Implementation additionally uses the
 273      * {@code jdk.security.provider.preferred} property to determine

 274      * the preferred provider order for the specified algorithm. This
 275      * may be different than the order of providers returned by
 276      * {@link Security#getProviders() Security.getProviders()}.
 277      *
 278      * @param algorithm the name of the RNG algorithm.
 279      * See the SecureRandom section in the <a href=
 280      * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
 281      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
 282      * for information about standard RNG algorithm names.
 283      *
 284      * @return the new SecureRandom object.
 285      *
 286      * @exception NoSuchAlgorithmException if no Provider supports a
 287      *          SecureRandomSpi implementation for the
 288      *          specified algorithm.
 289      *
 290      * @see Provider
 291      *
 292      * @since 1.2
 293      */




 253      * Random Number Generator (RNG) algorithm.
 254      *
 255      * <p> This method traverses the list of registered security Providers,
 256      * starting with the most preferred Provider.
 257      * A new SecureRandom object encapsulating the
 258      * SecureRandomSpi implementation from the first
 259      * Provider that supports the specified algorithm is returned.
 260      *
 261      * <p> Note that the list of registered providers may be retrieved via
 262      * the {@link Security#getProviders() Security.getProviders()} method.
 263      *
 264      * <p> The returned SecureRandom object has not been seeded.  To seed the
 265      * returned object, call the {@code setSeed} method.
 266      * If {@code setSeed} is not called, the first call to
 267      * {@code nextBytes} will force the SecureRandom object to seed itself.
 268      * This self-seeding will not occur if {@code setSeed} was
 269      * previously called.
 270      *
 271      * @implNote
 272      * The JDK Reference Implementation additionally uses the
 273      * {@code jdk.security.provider.preferred}
 274      * {@link Security#getProperty(String) Security} property to determine
 275      * the preferred provider order for the specified algorithm. This
 276      * may be different than the order of providers returned by
 277      * {@link Security#getProviders() Security.getProviders()}.
 278      *
 279      * @param algorithm the name of the RNG algorithm.
 280      * See the SecureRandom section in the <a href=
 281      * "{@docRoot}/../technotes/guides/security/StandardNames.html#SecureRandom">
 282      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
 283      * for information about standard RNG algorithm names.
 284      *
 285      * @return the new SecureRandom object.
 286      *
 287      * @exception NoSuchAlgorithmException if no Provider supports a
 288      *          SecureRandomSpi implementation for the
 289      *          specified algorithm.
 290      *
 291      * @see Provider
 292      *
 293      * @since 1.2
 294      */


< prev index next >