author | xuelei |
Thu, 23 Jun 2011 04:23:50 -0700 | |
changeset 10066 | bd28f59a9ae2 |
parent 7043 | 5e2d1edeb2c7 |
child 10328 | 06c93c42bca0 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
10066
bd28f59a9ae2
7057022: test/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java has invalid jtreg tags
xuelei
parents:
7043
diff
changeset
|
2 |
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
* |
|
5506 | 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. |
|
2 | 22 |
*/ |
23 |
||
24 |
/* |
|
25 |
* @test |
|
26 |
* @bug 6313675 6323647 |
|
27 |
* @summary Verify that all ciphersuites work in FIPS mode |
|
10066
bd28f59a9ae2
7057022: test/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java has invalid jtreg tags
xuelei
parents:
7043
diff
changeset
|
28 |
* @library .. |
7043 | 29 |
* @ignore JSSE supported cipher suites are changed with CR 6916074, |
30 |
* need to update this test case in JDK 7 soon |
|
2 | 31 |
* @author Andreas Sterbenz |
32 |
*/ |
|
33 |
||
34 |
import java.security.*; |
|
35 |
||
36 |
// This test belongs more in JSSE than here, but the JSSE workspace does not |
|
37 |
// have the NSS test infrastructure. It will live here for the time being. |
|
38 |
||
39 |
public class ClientJSSEServerJSSE extends SecmodTest { |
|
40 |
||
41 |
public static void main(String[] args) throws Exception { |
|
42 |
if (initSecmod() == false) { |
|
43 |
return; |
|
44 |
} |
|
45 |
||
46 |
if ("sparc".equals(System.getProperty("os.arch")) == false) { |
|
47 |
// we have not updated other platforms with the proper NSS libraries yet |
|
48 |
System.out.println("Test currently works only on solaris-sparc, skipping"); |
|
49 |
return; |
|
50 |
} |
|
51 |
||
52 |
String configName = BASE + SEP + "fips.cfg"; |
|
53 |
Provider p = getSunPKCS11(configName); |
|
54 |
||
55 |
System.out.println(p); |
|
56 |
Security.addProvider(p); |
|
57 |
||
58 |
Security.removeProvider("SunJSSE"); |
|
59 |
Provider jsse = new com.sun.net.ssl.internal.ssl.Provider(p); |
|
60 |
Security.addProvider(jsse); |
|
61 |
System.out.println(jsse.getInfo()); |
|
62 |
||
63 |
KeyStore ks = KeyStore.getInstance("PKCS11", p); |
|
64 |
ks.load(null, "test12".toCharArray()); |
|
65 |
||
66 |
CipherTest.main(new JSSEFactory(), ks, args); |
|
67 |
} |
|
68 |
||
69 |
private static class JSSEFactory extends CipherTest.PeerFactory { |
|
70 |
||
71 |
String getName() { |
|
72 |
return "Client JSSE - Server JSSE"; |
|
73 |
} |
|
74 |
||
75 |
CipherTest.Client newClient(CipherTest cipherTest) throws Exception { |
|
76 |
return new JSSEClient(cipherTest); |
|
77 |
} |
|
78 |
||
79 |
CipherTest.Server newServer(CipherTest cipherTest) throws Exception { |
|
80 |
return new JSSEServer(cipherTest); |
|
81 |
} |
|
82 |
} |
|
83 |
} |