KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > servicemix > jbi > security > keystore > KeystoreManager


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.servicemix.jbi.security.keystore;
18
19 import java.security.KeyManagementException JavaDoc;
20 import java.security.KeyStoreException JavaDoc;
21 import java.security.NoSuchAlgorithmException JavaDoc;
22 import java.security.NoSuchProviderException JavaDoc;
23 import java.security.UnrecoverableKeyException JavaDoc;
24
25 import javax.net.ssl.SSLServerSocketFactory;
26 import javax.net.ssl.SSLSocketFactory;
27
28 /**
29  * Based on http://svn.apache.org/repos/asf/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/KeystoreManager.java
30  *
31  */

32 public interface KeystoreManager {
33
34     KeystoreInstance getKeystore(String JavaDoc name);
35     
36     /**
37      * Gets a ServerSocketFactory using one Keystore to access the private key
38      * and another to provide the list of trusted certificate authorities.
39      * @param provider
40      * @param protocol The SSL protocol to use
41      * @param algorithm The SSL algorithm to use
42      * @param keyStore The key keystore name as provided by listKeystores. The
43      * KeystoreInstance for this keystore must be unlocked.
44      * @param keyAlias The name of the private key in the keystore. The
45      * KeystoreInstance for this keystore must have unlocked
46      * this key.
47      * @param trustStore The trust keystore name as provided by listKeystores.
48      * The KeystoreInstance for this keystore must have
49      * unlocked this key.
50      * @param loader The class loader used to resolve factory classes.
51      *
52      * @throws KeystoreIsLocked Occurs when the requested key keystore cannot
53      * be used because it has not been unlocked.
54      * @throws KeyIsLocked Occurs when the requested private key in the key
55      * keystore cannot be used because it has not been
56      * unlocked.
57      */

58     public SSLServerSocketFactory createSSLServerFactory(
59                                         String JavaDoc provider,
60                                         String JavaDoc protocol,
61                                         String JavaDoc algorithm,
62                                         String JavaDoc keyStore,
63                                         String JavaDoc keyAlias,
64                                         String JavaDoc trustStore)
65             throws KeystoreIsLocked, KeyIsLocked, NoSuchAlgorithmException JavaDoc, UnrecoverableKeyException JavaDoc, KeyStoreException JavaDoc, KeyManagementException JavaDoc, NoSuchProviderException JavaDoc;
66
67     /**
68      * Gets a SocketFactory using one Keystore to access the private key
69      * and another to provide the list of trusted certificate authorities.
70      * @param provider The SSL provider to use, or null for the default
71      * @param protocol The SSL protocol to use
72      * @param algorithm The SSL algorithm to use
73      * @param keyStore The key keystore name as provided by listKeystores. The
74      * KeystoreInstance for this keystore must be unlocked.
75      * @param keyAlias The name of the private key in the keystore. The
76      * KeystoreInstance for this keystore must have unlocked
77      * this key.
78      * @param trustStore The trust keystore name as provided by listKeystores.
79      * The KeystoreInstance for this keystore must have
80      * unlocked this key.
81      * @param loader The class loader used to resolve factory classes.
82      *
83      * @throws KeystoreIsLocked Occurs when the requested key keystore cannot
84      * be used because it has not been unlocked.
85      * @throws KeyIsLocked Occurs when the requested private key in the key
86      * keystore cannot be used because it has not been
87      * unlocked.
88      */

89     public SSLSocketFactory createSSLFactory(
90                                         String JavaDoc provider,
91                                         String JavaDoc protocol,
92                                         String JavaDoc algorithm,
93                                         String JavaDoc keyStore,
94                                         String JavaDoc keyAlias,
95                                         String JavaDoc trustStore)
96             throws KeystoreIsLocked, KeyIsLocked, NoSuchAlgorithmException JavaDoc, UnrecoverableKeyException JavaDoc, KeyStoreException JavaDoc, KeyManagementException JavaDoc, NoSuchProviderException JavaDoc;
97
98 }
99
Popular Tags