changeset 11825:8f8e3374c1bc

8079107: Update TestKeyPairGenerator.java to use random number generator library Reviewed-by: mullan
author darcy
date Thu, 30 Apr 2015 16:51:53 -0700
parents 409888e3ba56
children fd3281c40034
files test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java	Wed Apr 29 16:34:49 2015 -0700
+++ b/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java	Thu Apr 30 16:51:53 2015 -0700
@@ -24,9 +24,11 @@
 /**
  * @test
  * @bug 4856966
- * @summary Verify that the RSA KeyPairGenerator works
+ * @summary Verify that the RSA KeyPairGenerator works (use -Dseed=X to set PRNG seed)
  * @author Andreas Sterbenz
  * @library ..
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.*
  * @run main/othervm TestKeyPairGenerator
  * @key intermittent randomness
  */
@@ -106,7 +108,7 @@
         int[] keyLengths = {512, 512, 1024};
         BigInteger[] pubExps = {null, BigInteger.valueOf(3), null};
         KeyPair[] keyPairs = new KeyPair[3];
-        new Random().nextBytes(data);
+        RandomFactory.getRandom().nextBytes(data);
         KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", provider);
         for (int i = 0; i < keyLengths.length; i++) {
             int len = keyLengths[i];