2
|
1 |
/*
|
5506
|
2 |
* Copyright (c) 2004, 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 |
import javax.net.ssl.*;
|
|
25 |
import java.net.*;
|
|
26 |
import java.security.*;
|
|
27 |
import java.security.cert.*;
|
|
28 |
|
|
29 |
class MyX509KeyManager implements X509KeyManager {
|
|
30 |
|
|
31 |
X509KeyManager km;
|
|
32 |
|
|
33 |
MyX509KeyManager(X509KeyManager km) {
|
|
34 |
this.km = km;
|
|
35 |
}
|
|
36 |
|
|
37 |
public String[] getClientAliases(String keyType, Principal[] issuers) {
|
|
38 |
System.out.println("Calling from X509KeyManager");
|
|
39 |
return km.getClientAliases(keyType, issuers);
|
|
40 |
}
|
|
41 |
|
|
42 |
public String chooseClientAlias(String[] keyType, Principal[] issuers,
|
|
43 |
Socket socket) {
|
|
44 |
System.out.println("Calling from X509KeyManager");
|
|
45 |
return km.chooseClientAlias(keyType, issuers, socket);
|
|
46 |
}
|
|
47 |
|
|
48 |
public String[] getServerAliases(String keyType, Principal[] issuers) {
|
|
49 |
System.out.println("Calling from X509KeyManager");
|
|
50 |
return km.getServerAliases(keyType, issuers);
|
|
51 |
}
|
|
52 |
|
|
53 |
public String chooseServerAlias(String keyType, Principal[] issuers,
|
|
54 |
Socket socket) {
|
|
55 |
System.out.println("Calling from X509KeyManager");
|
|
56 |
return km.chooseServerAlias(keyType, issuers, socket);
|
|
57 |
}
|
|
58 |
|
|
59 |
public X509Certificate[] getCertificateChain(String alias) {
|
|
60 |
System.out.println("Calling from X509KeyManager");
|
|
61 |
return km.getCertificateChain(alias);
|
|
62 |
}
|
|
63 |
|
|
64 |
public PrivateKey getPrivateKey(String alias) {
|
|
65 |
System.out.println("Calling from X509KeyManager");
|
|
66 |
return km.getPrivateKey(alias);
|
|
67 |
}
|
|
68 |
}
|