Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/net/ssl/X509KeyManager.java
38922 views
/*1* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425/*26* NOTE: this file was copied from javax.net.ssl.X509KeyManager27*/2829package com.sun.net.ssl;3031import java.security.KeyManagementException;32import java.security.PrivateKey;33import java.security.Principal;34import java.security.cert.X509Certificate;3536/**37* Instances of this interface manage which X509 certificate-based38* key pairs are used to authenticate the local side of a secure39* socket. The individual entries are identified by unique alias names.40*41* @deprecated As of JDK 1.4, this implementation-specific class was42* replaced by {@link javax.net.ssl.X509KeyManager}.43*/44@Deprecated45public interface X509KeyManager extends KeyManager {46/**47* Get the matching aliases for authenticating the client side of a secure48* socket given the public key type and the list of49* certificate issuer authorities recognized by the peer (if any).50*51* @param keyType the key algorithm type name52* @param issuers the list of acceptable CA issuer subject names53* @return the matching alias names54*/55public String[] getClientAliases(String keyType, Principal[] issuers);5657/**58* Choose an alias to authenticate the client side of a secure59* socket given the public key type and the list of60* certificate issuer authorities recognized by the peer (if any).61*62* @param keyType the key algorithm type name63* @param issuers the list of acceptable CA issuer subject names64* @return the alias name for the desired key65*/66public String chooseClientAlias(String keyType, Principal[] issuers);6768/**69* Get the matching aliases for authenticating the server side of a secure70* socket given the public key type and the list of71* certificate issuer authorities recognized by the peer (if any).72*73* @param keyType the key algorithm type name74* @param issuers the list of acceptable CA issuer subject names75* @return the matching alias names76*/77public String[] getServerAliases(String keyType, Principal[] issuers);7879/**80* Choose an alias to authenticate the server side of a secure81* socket given the public key type and the list of82* certificate issuer authorities recognized by the peer (if any).83*84* @param keyType the key algorithm type name85* @param issuers the list of acceptable CA issuer subject names86* @return the alias name for the desired key87*/88public String chooseServerAlias(String keyType, Principal[] issuers);8990/**91* Returns the certificate chain associated with the given alias.92*93* @param alias the alias name94*95* @return the certificate chain (ordered with the user's certificate first96* and the root certificate authority last)97*/98public X509Certificate[] getCertificateChain(String alias);99100/*101* Returns the key associated with the given alias.102*103* @param alias the alias name104*105* @return the requested key106*/107public PrivateKey getPrivateKey(String alias);108}109110111