Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/net/ssl/TrustManagerFactorySpi.java
38918 views
/*1* Copyright (c) 1999, 2008, 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.*;2829/**30* This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)31* for the <code>TrustManagerFactory</code> class.32*33* <p> All the abstract methods in this class must be implemented by each34* cryptographic service provider who wishes to supply the implementation35* of a particular trust manager factory.36*37* @since 1.438* @see TrustManagerFactory39* @see TrustManager40*/41public abstract class TrustManagerFactorySpi {42/**43* Initializes this factory with a source of certificate44* authorities and related trust material.45*46* @param ks the key store or null47* @throws KeyStoreException if this operation fails48* @see TrustManagerFactory#init(KeyStore)49*/50protected abstract void engineInit(KeyStore ks) throws KeyStoreException;5152/**53* Initializes this factory with a source of provider-specific54* key material.55* <P>56* In some cases, initialization parameters other than a keystore57* may be needed by a provider. Users of that58* particular provider are expected to pass an implementation of59* the appropriate <CODE>ManagerFactoryParameters</CODE> as60* defined by the provider. The provider can then call the61* specified methods in the <CODE>ManagerFactoryParameters</CODE>62* implementation to obtain the needed information.63*64* @param spec an implementation of a provider-specific parameter65* specification66* @throws InvalidAlgorithmParameterException if there is problem67* with the parameters68* @see TrustManagerFactory#init(ManagerFactoryParameters spec)69*/70protected abstract void engineInit(ManagerFactoryParameters spec)71throws InvalidAlgorithmParameterException;7273/**74* Returns one trust manager for each type of trust material.75*76* @throws IllegalStateException if the factory is not initialized.77*78* @return the trust managers79*/80protected abstract TrustManager[] engineGetTrustManagers();81}828384