KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > server > pluggable > SecuritySupport


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise.server.pluggable;
24
25 import java.security.KeyStore JavaDoc;
26 import com.sun.enterprise.config.ConfigContext;
27
28 /**
29  * SecuritySupport is part of PluggableFeature that provides access to
30  * internal services managed by application server.
31  * @author Shing Wai Chan
32  */

33 public interface SecuritySupport {
34
35     /**
36      * This method returns an array of keystores containing keys and
37      * certificates.
38      */

39     public KeyStore JavaDoc[] getKeyStores();
40
41     /**
42      * This method returns an array of truststores containing certificates.
43      */

44     public KeyStore JavaDoc[] getTrustStores();
45
46     /**
47      * This method returns an array of passwords in order corresponding to
48      * array of keystores.
49      */

50     public String JavaDoc[] getKeyStorePasswords();
51
52     /**
53      * @param token
54      * @return a keystore. If token is null, return the the first keystore.
55      */

56     public KeyStore JavaDoc getKeyStore(String JavaDoc token);
57
58     /**
59      * @param token
60      * @return a truststore. If token is null, return the first truststore.
61      */

62     public KeyStore JavaDoc getTrustStore(String JavaDoc token);
63
64     /**
65      * @param token
66      * @return the password for this token.
67      */

68     public String JavaDoc getKeyStorePassword(String JavaDoc token);
69     
70     /**
71      * This method returns an array of token names in order corresponding to
72      * array of keystores.
73      */

74     public String JavaDoc[] getTokenNames();
75
76     /**
77      * This method synchronize key file for given realm.
78      * @param config the ConfigContextx
79      * @param fileRealmName
80      * @exception if fail to synchronize, a known exception is
81      * com.sun.enterprise.ee.synchronization.SynchronizationException
82      */

83     public void synchronizeKeyFile(ConfigContext config, String JavaDoc fileRealmName)
84         throws Exception JavaDoc;
85 }
86
Popular Tags