KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)KeyManagerFactorySpi.java 1.9 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 /**
21  * This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
22  * for the <code>KeyManagerFactory</code> class.
23  *
24  * <p> All the abstract methods in this class must be implemented by each
25  * cryptographic service provider who wishes to supply the implementation
26  * of a particular key manager factory.
27  *
28  * @since 1.4
29  * @see KeyManagerFactory
30  * @see KeyManager
31  * @version 1.13
32  */

33 public abstract class KeyManagerFactorySpi
34 {
35
36     public KeyManagerFactorySpi() { }
37
38     /**
39      * Initializes this factory with a source of key material.
40      *
41      * @param ks the key store or null
42      * @param password the password for recovering keys
43      * @throws KeyStoreException if this operation fails
44      * @throws NoSuchAlgorithmException if the specified algorithm is not
45      * available from the specified provider.
46      * @throws UnrecoverableKeyException if the key cannot be recovered
47      * @see KeyManagerFactory#init(KeyStore, char[])
48      */

49     protected abstract void engineInit(KeyStore ks, char[] password)
50         throws KeyStoreException, NoSuchAlgorithmException,
51         UnrecoverableKeyException;
52
53     /**
54      * Initializes this factory with a source of key material.
55      * <P>
56      * In some cases, initialization parameters other than a keystore
57      * and password may be needed by a provider. Users of that
58      * particular provider are expected to pass an implementation of
59      * the appropriate <CODE>ManagerFactoryParameters</CODE> as
60      * defined by the provider. The provider can then call the
61      * specified methods in the ManagerFactoryParameters
62      * implementation to obtain the needed information.
63      *
64      * @param spec an implementation of a provider-specific parameter
65      * specification
66      * @throws InvalidAlgorithmParameterException if there is problem
67      * with the parameters
68      * @see KeyManagerFactory#init(ManagerFactoryParameters spec)
69      */

70     protected abstract void engineInit(ManagerFactoryParameters spec)
71         throws InvalidAlgorithmParameterException;
72
73     /**
74      * Returns one key manager for each type of key material.
75      *
76      * @return the key managers
77      */

78     protected abstract KeyManager[] engineGetKeyManagers();
79 }
80
Popular Tags