11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 4856966
27 * @summary Verify that the RSA KeyPairGenerator works
28 * @author Andreas Sterbenz
29 * @library ..
30 * @run main/othervm TestKeyPairGenerator
31 */
32
33 import java.io.*;
34 import java.util.*;
35 import java.math.BigInteger;
36
37 import java.security.*;
38 import java.security.interfaces.*;
39 import java.security.spec.*;
40
41 public class TestKeyPairGenerator extends PKCS11Test {
42
43 private static Provider provider;
44
45 private static byte[] data;
46
47 private static void testSignature(String algorithm, PrivateKey privateKey, PublicKey publicKey) throws Exception {
48 System.out.println("Testing " + algorithm + "...");
49 Signature s = Signature.getInstance(algorithm, provider);
50 s.initSign(privateKey);
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 4856966
27 * @summary Verify that the RSA KeyPairGenerator works
28 * @author Andreas Sterbenz
29 * @library ..
30 * @run main/othervm TestKeyPairGenerator
31 * @key randomness
32 */
33
34 import java.io.*;
35 import java.util.*;
36 import java.math.BigInteger;
37
38 import java.security.*;
39 import java.security.interfaces.*;
40 import java.security.spec.*;
41
42 public class TestKeyPairGenerator extends PKCS11Test {
43
44 private static Provider provider;
45
46 private static byte[] data;
47
48 private static void testSignature(String algorithm, PrivateKey privateKey, PublicKey publicKey) throws Exception {
49 System.out.println("Testing " + algorithm + "...");
50 Signature s = Signature.getInstance(algorithm, provider);
51 s.initSign(privateKey);
|