TestEC.java revision 1674:845fefff00a4
1/* 2 * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 20 * CA 95054 USA or visit www.sun.com if you need additional information or 21 * have any questions. 22 */ 23 24/** 25 * @test 26 * @bug 6840752 27 * @summary Provide out-of-the-box support for ECC algorithms 28 * @library ../pkcs11 29 * @library ../pkcs11/ec 30 * @library ../pkcs11/sslecc 31 * @compile -XDignore.symbol.file TestEC.java 32 * @run main TestEC 33 */ 34 35import java.security.Provider; 36 37/* 38 * Leverage the collection of EC tests used by PKCS11 39 * 40 * NOTE: the following 6 files were copied here from the PKCS11 EC Test area 41 * and must be kept in sync with the originals: 42 * 43 * ../pkcs11/ec/p12passwords.txt 44 * ../pkcs11/ec/certs/sunlabscerts.pem 45 * ../pkcs11/ec/pkcs12/secp256r1server-secp384r1ca.p12 46 * ../pkcs11/ec/pkcs12/sect193r1server-rsa1024ca.p12 47 * ../pkcs11/sslecc/keystore 48 * ../pkcs11/sslecc/truststore 49 */ 50 51public class TestEC { 52 53 public static void main(String[] args) throws Exception { 54 Provider p = new sun.security.ec.SunEC(); 55 System.out.println("Running tests with " + p.getName() + 56 " provider...\n"); 57 long start = System.currentTimeMillis(); 58 59 /* 60 * The entry point used for each test is its instance method 61 * called main (not its static method called main). 62 */ 63 new TestECDH().main(p); 64 new TestECDSA().main(p); 65 new TestCurves().main(p); 66 new TestKeyFactory().main(p); 67 new TestECGenSpec().main(p); 68 new ReadPKCS12().main(p); 69 new ReadCertificates().main(p); 70 new ClientJSSEServerJSSE().main(p); 71 72 long stop = System.currentTimeMillis(); 73 System.out.println("\nCompleted tests with " + p.getName() + 74 " provider (" + ((stop - start) / 1000.0) + " seconds)."); 75 } 76} 77