KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > net > ssl > TrustManagerFactory


1 /*
2  * @(#)TrustManagerFactory.java 1.10 04/02/16
3  *
4  * Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7   
8 /*
9  * NOTE:
10  * Because of various external restrictions (i.e. US export
11  * regulations, etc.), the actual source code can not be provided
12  * at this time. This file represents the skeleton of the source
13  * file, so that javadocs of the API can be created.
14  */

15
16 package javax.net.ssl;
17
18 import java.security.*;
19
20 import java.security.Security;
21 import sun.security.jca.GetInstance;
22
23 /**
24  * This class acts as a factory for trust managers based on a
25  * source of trust material. Each trust manager manages a specific
26  * type of trust material for use by secure sockets. The trust
27  * material is based on a KeyStore and/or provider specific sources.
28  *
29  * @since 1.4
30  * @see TrustManager
31  * @version 1.15, 01/29/04
32  */

33 public class TrustManagerFactory
34 {
35
36     /**
37      * Creates a TrustManagerFactory object.
38      *
39      * @param factorySpi the delegate
40      * @param provider the provider
41      * @param algorithm the algorithm
42      */

43     protected TrustManagerFactory(TrustManagerFactorySpi factorySpi, Provider
44         provider, String algorithm)
45     { }
46
47     /**
48      * Obtains the default TrustManagerFactory algorithm name.
49      *
50      * <p>The default TrustManager can be changed at runtime by setting
51      * the value of the "ssl.TrustManagerFactory.algorithm" security
52      * property (set in the Java security properties file or by calling
53      * {@link java.security.Security#setProperty(String, String) })
54      * to the desired algorithm name.
55      *
56      * @return the default algorithm name as specified in the
57      * Java security properties, or an implementation-specific default
58      * if no such property exists.
59      */

60     public static final String getDefaultAlgorithm() {
61         return null;
62     }
63
64     /**
65      * Returns the algorithm name of this <code>TrustManagerFactory</code>
66      * object.
67      *
68      * <p>This is the same name that was specified in one of the
69      * <code>getInstance</code> calls that created this
70      * <code>TrustManagerFactory</code> object.
71      *
72      * @return the algorithm name of this <code>TrustManagerFactory</code>
73      * object
74      */

75     public final String getAlgorithm() {
76         return null;
77     }
78
79     /**
80      * Generates a <code>TrustManagerFactory</code> object that implements the
81      * specified trust management algorithm.
82      * <P>
83      * If the default provider package provides an implementation of the
84      * requested trust management algorithm, an instance of
85      * <code>TrustManagerFactory</code> containing that implementation is
86      * returned. If the algorithm is not available in the default provider
87      * package, other provider packages are searched.
88      *
89      * @param algorithm the standard name of the requested trust management
90      * algorithm.
91      * @return the new <code>TrustManagerFactory</code> object
92      * @exception NoSuchAlgorithmException if the specified algorithm is not
93      * available in the default provider package or any of the other
94      * provider packages that were searched.
95      */

96     public static final TrustManagerFactory getInstance(String algorithm)
97         throws NoSuchAlgorithmException
98     {
99         return null;
100     }
101
102     /**
103      * Generates a <code>TrustManagerFactory</code> object for the specified
104      * trust management algorithm from the specified provider.
105      *
106      * @param algorithm the standard name of the requested trust management
107      * algorithm.
108      * @param provider the name of the provider
109      * @return the new <code>TrustManagerFactory</code> object
110      * @throws NoSuchAlgorithmException if the specified algorithm is not
111      * available from the specified provider.
112      * @throws NoSuchProviderException if the specified provider has not
113      * been configured.
114      * @throws IllegalArgumentException if the provider name is null or empty.
115      */

116     public static final TrustManagerFactory getInstance(String algorithm, String
117         provider) throws NoSuchAlgorithmException, NoSuchProviderException
118     {
119         return null;
120     }
121
122     /**
123      * Generates a <code>TrustManagerFactory</code> object for the specified
124      * trust management algorithm from the specified provider.
125      *
126      * @param algorithm the standard name of the requested trust management
127      * algorithm.
128      * @param provider an instance of the provider
129      * @return the new <code>TrustManagerFactory</code> object
130      * @throws NoSuchAlgorithmException if the specified algorithm is not
131      * available from the specified provider.
132      * @throws IllegalArgumentException if the provider is null.
133      */

134     public static final TrustManagerFactory getInstance(String algorithm,
135         Provider provider) throws NoSuchAlgorithmException
136     {
137         return null;
138     }
139
140     /**
141      * Returns the provider of this <code>TrustManagerFactory</code> object.
142      *
143      * @return the provider of this <code>TrustManagerFactory</code> object
144      */

145     public final Provider getProvider() {
146         return null;
147     }
148
149     /**
150      * Initializes this factory with a source of certificate
151      * authorities and related trust material.
152      * <P>
153      * The provider typically uses a KeyStore as a basis for making
154      * trust decisions.
155      * <P>
156      * For more flexible initialization, please see
157      * {@link #init(ManagerFactoryParameters)}.
158      *
159      * @param ks the key store, or null
160      * @throws KeyStoreException if this operation fails
161      */

162     public final void init(KeyStore ks) throws KeyStoreException { }
163
164     /**
165      * Initializes this factory with a source of provider-specific
166      * trust material.
167      * <P>
168      * In some cases, initialization parameters other than a keystore
169      * may be needed by a provider. Users of that particular provider
170      * are expected to pass an implementation of the appropriate
171      * <CODE>ManagerFactoryParameters</CODE> as defined by the
172      * provider. The provider can then call the specified methods in
173      * the <CODE>ManagerFactoryParameters</CODE> implementation to obtain the
174      * needed information.
175      *
176      * @param spec an implementation of a provider-specific parameter
177      * specification
178      * @throws InvalidAlgorithmParameterException if an error is
179      * encountered
180      */

181     public final void init(ManagerFactoryParameters spec)
182         throws InvalidAlgorithmParameterException
183     { }
184
185     /**
186      * Returns one trust manager for each type of trust material.
187      *
188      * @return the trust managers
189      */

190     public final TrustManager[] getTrustManagers() {
191         return null;
192     }
193 }
194
Popular Tags