< prev index next >

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

Print this page




 126  * @implSpec
 127  * A {@code SecureRandom} service provider can advertise that it is thread-safe
 128  * by setting the <a href=
 129  * "{@docRoot}/../specs/security/standard-names.html#service-attributes">service
 130  * provider attribute</a> "ThreadSafe" to "true" when registering the provider.
 131  * Otherwise, this class will instead synchronize access to the following
 132  * methods of the {@code SecureRandomSpi} implementation:
 133  * <ul>
 134  * <li>{@link SecureRandomSpi#engineSetSeed(byte[])}
 135  * <li>{@link SecureRandomSpi#engineNextBytes(byte[])}
 136  * <li>{@link SecureRandomSpi#engineNextBytes(byte[], SecureRandomParameters)}
 137  * <li>{@link SecureRandomSpi#engineGenerateSeed(int)}
 138  * <li>{@link SecureRandomSpi#engineReseed(SecureRandomParameters)}
 139  * </ul>
 140  *
 141  * @see java.security.SecureRandomSpi
 142  * @see java.util.Random
 143  *
 144  * @author Benjamin Renaud
 145  * @author Josh Bloch

 146  */
 147 
 148 public class SecureRandom extends java.util.Random {
 149 
 150     private static final Debug pdebug =
 151                         Debug.getInstance("provider", "Provider");
 152     private static final boolean skipDebug =
 153         Debug.isOn("engine=") && !Debug.isOn("securerandom");
 154 
 155     /**
 156      * The provider.
 157      *
 158      * @serial
 159      * @since 1.2
 160      */
 161     private Provider provider = null;
 162 
 163     /**
 164      * The provider implementation.
 165      *




 126  * @implSpec
 127  * A {@code SecureRandom} service provider can advertise that it is thread-safe
 128  * by setting the <a href=
 129  * "{@docRoot}/../specs/security/standard-names.html#service-attributes">service
 130  * provider attribute</a> "ThreadSafe" to "true" when registering the provider.
 131  * Otherwise, this class will instead synchronize access to the following
 132  * methods of the {@code SecureRandomSpi} implementation:
 133  * <ul>
 134  * <li>{@link SecureRandomSpi#engineSetSeed(byte[])}
 135  * <li>{@link SecureRandomSpi#engineNextBytes(byte[])}
 136  * <li>{@link SecureRandomSpi#engineNextBytes(byte[], SecureRandomParameters)}
 137  * <li>{@link SecureRandomSpi#engineGenerateSeed(int)}
 138  * <li>{@link SecureRandomSpi#engineReseed(SecureRandomParameters)}
 139  * </ul>
 140  *
 141  * @see java.security.SecureRandomSpi
 142  * @see java.util.Random
 143  *
 144  * @author Benjamin Renaud
 145  * @author Josh Bloch
 146  * @since 1.1
 147  */
 148 
 149 public class SecureRandom extends java.util.Random {
 150 
 151     private static final Debug pdebug =
 152                         Debug.getInstance("provider", "Provider");
 153     private static final boolean skipDebug =
 154         Debug.isOn("engine=") && !Debug.isOn("securerandom");
 155 
 156     /**
 157      * The provider.
 158      *
 159      * @serial
 160      * @since 1.2
 161      */
 162     private Provider provider = null;
 163 
 164     /**
 165      * The provider implementation.
 166      *


< prev index next >