Path: blob/master/src/java.base/share/classes/javax/net/ssl/X509ExtendedKeyManager.java
41159 views
/*1* Copyright (c) 2004, 2018, 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*/2425package javax.net.ssl;2627import java.security.Principal;2829/**30* Abstract class that provides for extension of the X509KeyManager31* interface.32* <P>33* Methods in this class should be overridden to provide actual34* implementations.35*36* @since 1.537* @author Brad R. Wetmore38*/39public abstract class X509ExtendedKeyManager implements X509KeyManager {4041/**42* Constructor used by subclasses only.43*/44protected X509ExtendedKeyManager() {45}4647/**48* Choose an alias to authenticate the client side of an49* <code>SSLEngine</code> connection given the public key type50* and the list of certificate issuer authorities recognized by51* the peer (if any).52* <P>53* The default implementation returns null.54*55* @param keyType the key algorithm type name(s), ordered56* with the most-preferred key type first.57* @param issuers the list of acceptable CA issuer subject names58* or null if it does not matter which issuers are used.59* @param engine the <code>SSLEngine</code> to be used for this60* connection. This parameter can be null, which indicates61* that implementations of this interface are free to62* select an alias applicable to any engine.63* @return the alias name for the desired key, or null if there64* are no matches.65*/66public String chooseEngineClientAlias(String[] keyType,67Principal[] issuers, SSLEngine engine) {68return null;69}7071/**72* Choose an alias to authenticate the server side of an73* <code>SSLEngine</code> connection given the public key type74* and the list of certificate issuer authorities recognized by75* the peer (if any).76* <P>77* The default implementation returns null.78*79* @param keyType the key algorithm type name.80* @param issuers the list of acceptable CA issuer subject names81* or null if it does not matter which issuers are used.82* @param engine the <code>SSLEngine</code> to be used for this83* connection. This parameter can be null, which indicates84* that implementations of this interface are free to85* select an alias applicable to any engine.86* @return the alias name for the desired key, or null if there87* are no matches.88*/89public String chooseEngineServerAlias(String keyType,90Principal[] issuers, SSLEngine engine) {91return null;92}9394}959697