jdk/test/sun/security/pkcs11/Signature/TestRSAKeyLength.java
changeset 12685 8a448b5b9006
parent 5506 202f599c92aa
child 18804 8561f2098727
equal deleted inserted replaced
12676:3b7fae360d04 12685:8a448b5b9006
     1 /*
     1 /*
     2  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    35     public static void main(String[] args) throws Exception {
    35     public static void main(String[] args) throws Exception {
    36         main(new TestRSAKeyLength());
    36         main(new TestRSAKeyLength());
    37     }
    37     }
    38     public void main(Provider p) throws Exception {
    38     public void main(Provider p) throws Exception {
    39         boolean isValidKeyLength[] = { true, true, false, false };
    39         boolean isValidKeyLength[] = { true, true, false, false };
    40         String algos[] = { "SHA1withRSA", "SHA256withRSA",
    40         String algos[] = { "SHA1withRSA", "SHA224withRSA", "SHA256withRSA",
    41                            "SHA384withRSA", "SHA512withRSA" };
    41                            "SHA384withRSA", "SHA512withRSA" };
    42         KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p);
    42         KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", p);
    43         kpg.initialize(512);
    43         kpg.initialize(512);
    44         KeyPair kp = kpg.generateKeyPair();
    44         KeyPair kp = kpg.generateKeyPair();
    45         PrivateKey privKey = kp.getPrivate();
    45         PrivateKey privKey = kp.getPrivate();