TestEC.java revision 1584:dd997cc0c823
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 * @run main TestEC 31 */ 32 33import java.security.Provider; 34 35/* 36 * Leverage the collection of EC tests used by PKCS11 37 * 38 * NOTE: the following files were copied here from the PKCS11 EC Test area 39 * and must be kept in sync with the originals: 40 * 41 * ../pkcs11/ec/p12passwords.txt 42 * ../pkcs11/ec/pkcs12/secp256r1server-secp384r1ca.p12 43 * ../pkcs11/ec/pkcs12/sect193r1server-rsa1024ca.p12 44 */ 45 46public class TestEC { 47 48 public static void main(String[] args) throws Exception { 49 Provider p = new sun.security.ec.SunEC(); 50 System.out.println("Running tests with " + p.getName() + 51 " provider...\n"); 52 53 long start = System.currentTimeMillis(); 54 new TestECDH().main(p); 55 new TestECDSA().main(p); 56 new TestCurves().main(p); 57 new TestKeyFactory().main(p); 58 new TestECGenSpec().main(p); 59 new ReadPKCS12().main(p); 60 //new ReadCertificates().main(p); 61 long stop = System.currentTimeMillis(); 62 63 System.out.println("\nCompleted tests with " + p.getName() + 64 " provider (" + (stop - start) + " ms)."); 65 } 66} 67