1/*
2 * Copyright (c) 2000, 2017, Oracle and/or its affiliates. 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.  Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26/*
27 * NOTE:  this file was copied from javax.net.ssl.X509KeyManager
28 */
29
30package com.sun.net.ssl;
31
32import java.security.KeyManagementException;
33import java.security.PrivateKey;
34import java.security.Principal;
35import java.security.cert.X509Certificate;
36
37/**
38 * Instances of this interface manage which X509 certificate-based
39 * key pairs are used to authenticate the local side of a secure
40 * socket. The individual entries are identified by unique alias names.
41 *
42 * @deprecated As of JDK 1.4, this implementation-specific class was
43 *      replaced by {@link javax.net.ssl.X509KeyManager}.
44 */
45@Deprecated(since="1.4")
46public interface X509KeyManager extends KeyManager {
47    /**
48     * Get the matching aliases for authenticating the client side of a secure
49     * socket given the public key type and the list of
50     * certificate issuer authorities recognized by the peer (if any).
51     *
52     * @param keyType the key algorithm type name
53     * @param issuers the list of acceptable CA issuer subject names
54     * @return the matching alias names
55     */
56    public String[] getClientAliases(String keyType, Principal[] issuers);
57
58    /**
59     * Choose an alias to authenticate the client side of a secure
60     * socket given the public key type and the list of
61     * certificate issuer authorities recognized by the peer (if any).
62     *
63     * @param keyType the key algorithm type name
64     * @param issuers the list of acceptable CA issuer subject names
65     * @return the alias name for the desired key
66     */
67    public String chooseClientAlias(String keyType, Principal[] issuers);
68
69    /**
70     * Get the matching aliases for authenticating the server side of a secure
71     * socket given the public key type and the list of
72     * certificate issuer authorities recognized by the peer (if any).
73     *
74     * @param keyType the key algorithm type name
75     * @param issuers the list of acceptable CA issuer subject names
76     * @return the matching alias names
77     */
78    public String[] getServerAliases(String keyType, Principal[] issuers);
79
80    /**
81     * Choose an alias to authenticate the server side of a secure
82     * socket given the public key type and the list of
83     * certificate issuer authorities recognized by the peer (if any).
84     *
85     * @param keyType the key algorithm type name
86     * @param issuers the list of acceptable CA issuer subject names
87     * @return the alias name for the desired key
88     */
89    public String chooseServerAlias(String keyType, Principal[] issuers);
90
91    /**
92     * Returns the certificate chain associated with the given alias.
93     *
94     * @param alias the alias name
95     *
96     * @return the certificate chain (ordered with the user's certificate first
97     * and the root certificate authority last)
98     */
99    public X509Certificate[] getCertificateChain(String alias);
100
101    /*
102     * Returns the key associated with the given alias.
103     *
104     * @param alias the alias name
105     *
106     * @return the requested key
107     */
108    public PrivateKey getPrivateKey(String alias);
109}
110