KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > security > plugins > JaasSecurityDomainMBean


1 /*
2  * JBoss, the OpenSource WebOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.security.plugins;
8
9 import java.io.IOException JavaDoc;
10 import javax.management.ObjectName JavaDoc;
11 import org.jboss.system.ServiceMBean;
12
13
14 /** The JaasSecurityDomainMBean adds support for KeyStore management.
15
16  @author Scott.Stark@jboss.org
17  @author <a HREF="mailto:jasone@greenrivercomputing.com">Jason Essington</a>
18  @version $Revision: 1.7 $
19 */

20 public interface JaasSecurityDomainMBean extends ServiceMBean
21 {
22    /** KeyStore implementation type being used.
23     @return the KeyStore implementation type being used.
24     */

25    public String JavaDoc getKeyStoreType();
26    /** Set the type of KeyStore implementation to use. This is
27     passed to the KeyStore.getInstance() factory method.
28     */

29    public void setKeyStoreType(String JavaDoc type);
30    /** Get the KeyStore database URL string.
31     */

32    public String JavaDoc getKeyStoreURL();
33    /** Set the KeyStore database URL string. This is used to obtain
34     an InputStream to initialize the KeyStore.
35     */

36    public void setKeyStoreURL(String JavaDoc storeURL) throws IOException JavaDoc;
37     /** Set the credential string for the KeyStore.
38     */

39    public void setKeyStorePass(String JavaDoc password);
40
41    /** Get the type of the trust store
42     * @return the type of the trust store
43     */

44    public String JavaDoc getTrustStoreType();
45    /** Set the type of the trust store
46     * @param type - the trust store implementation type
47     */

48    public void setTrustStoreType(String JavaDoc type);
49    /** Set the credential string for the trust store.
50    */

51    public void setTrustStorePass(String JavaDoc password);
52    /** Get the trust store database URL string.
53     */

54    public String JavaDoc getTrustStoreURL();
55    /** Set the trust store database URL string. This is used to obtain
56     an InputStream to initialize the trust store.
57     */

58    public void setTrustStoreURL(String JavaDoc storeURL) throws IOException JavaDoc;
59    /**
60        Reload the key- and truststore
61    */

62    public void reloadKeyAndTrustStore() throws Exception JavaDoc;
63    /** The JMX object name string of the security manager service.
64     @return The JMX object name string of the security manager service.
65     */

66    public ObjectName JavaDoc getManagerServiceName();
67    /** Set the JMX object name string of the security manager service.
68     */

69    public void setManagerServiceName(ObjectName JavaDoc jmxName);
70
71    /** Set the salt used with PBE based on the keystore password.
72     * @param salt - an 8 char randomization string
73     */

74    public void setSalt(String JavaDoc salt);
75    /** Set the iteration count used with PBE based on the keystore password.
76     * @param count - an iteration count randomization value
77     */

78    public void setIterationCount(int count);
79
80    /** Encode a secret using the keystore password and PBEwithMD5andDES algo
81     * @param secret - the byte sequence to encrypt
82     * @return the encrypted byte sequence
83     * @throws Exception
84     */

85    public byte[] encode(byte[] secret)
86       throws Exception JavaDoc;
87
88    /** Decode a secret using the keystore password and PBEwithMD5andDES algo
89     * @param secret - the byte sequence to decrypt
90     * @return the decrypted byte sequence
91     * @throws Exception
92     */

93    public byte[] decode(byte[] secret)
94       throws Exception JavaDoc;
95
96    /** Encode a secret using the keystore password and PBEwithMD5andDES algo
97     * @param secret - the byte sequence to encrypt as a base64 string using
98     * the Util.tob64() function
99     * @return the encrypted byte sequence
100     * @throws Exception
101     */

102    public String JavaDoc encode64(byte[] secret)
103       throws Exception JavaDoc;
104
105    /** Decode a secret using the keystore password and PBEwithMD5andDES algo
106     * @param secret - the Util.tob64 string represention to decrypt
107     * @return the decrypted byte sequence
108     * @throws Exception
109     */

110    public byte[] decode64(String JavaDoc secret)
111       throws Exception JavaDoc;
112 }
113
Popular Tags