001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.security.plugins;
023:
024: import java.io.IOException;
025: import javax.management.ObjectName;
026: import org.jboss.system.ServiceMBean;
027:
028: /** The JaasSecurityDomainMBean adds support for KeyStore management.
029:
030: @author Scott.Stark@jboss.org
031: @author <a href="mailto:jasone@greenrivercomputing.com">Jason Essington</a>
032: @version $Revision: 59905 $
033: */
034: public interface JaasSecurityDomainMBean extends ServiceMBean {
035: /** KeyStore implementation type being used.
036: @return the KeyStore implementation type being used.
037: */
038: public String getKeyStoreType();
039:
040: /** Set the type of KeyStore implementation to use. This is
041: passed to the KeyStore.getInstance() factory method.
042: */
043: public void setKeyStoreType(String type);
044:
045: /** Get the KeyStore database URL string.
046: */
047: public String getKeyStoreURL();
048:
049: /** Set the KeyStore database URL string. This is used to obtain
050: an InputStream to initialize the KeyStore.
051: */
052: public void setKeyStoreURL(String storeURL) throws IOException;
053:
054: /** Set the credential string for the KeyStore.
055: */
056: public void setKeyStorePass(String password) throws Exception;
057:
058: /** Get the type of the trust store
059: * @return the type of the trust store
060: */
061: public String getTrustStoreType();
062:
063: /** Set the type of the trust store
064: * @param type - the trust store implementation type
065: */
066: public void setTrustStoreType(String type);
067:
068: /** Set the credential string for the trust store.
069: */
070: public void setTrustStorePass(String password);
071:
072: /** Get the trust store database URL string.
073: */
074: public String getTrustStoreURL();
075:
076: /** Set the trust store database URL string. This is used to obtain
077: an InputStream to initialize the trust store.
078: */
079: public void setTrustStoreURL(String storeURL) throws IOException;
080:
081: /**
082: Reload the key- and truststore
083: */
084: public void reloadKeyAndTrustStore() throws Exception;
085:
086: /** The JMX object name string of the security manager service.
087: @return The JMX object name string of the security manager service.
088: */
089: public ObjectName getManagerServiceName();
090:
091: /** Set the JMX object name string of the security manager service.
092: */
093: public void setManagerServiceName(ObjectName jmxName);
094:
095: /** Set the salt used with PBE based on the keystore password.
096: * @param salt - an 8 char randomization string
097: */
098: public void setSalt(String salt);
099:
100: /** Set the iteration count used with PBE based on the keystore password.
101: * @param count - an iteration count randomization value
102: */
103: public void setIterationCount(int count);
104:
105: /** Encode a secret using the keystore password and PBEwithMD5andDES algo
106: * @param secret - the byte sequence to encrypt
107: * @return the encrypted byte sequence
108: * @throws Exception
109: */
110: public byte[] encode(byte[] secret) throws Exception;
111:
112: /** Decode a secret using the keystore password and PBEwithMD5andDES algo
113: * @param secret - the byte sequence to decrypt
114: * @return the decrypted byte sequence
115: * @throws Exception
116: */
117: public byte[] decode(byte[] secret) throws Exception;
118:
119: /** Encode a secret using the keystore password and PBEwithMD5andDES algo
120: * @param secret - the byte sequence to encrypt as a base64 string using
121: * the Util.tob64() function
122: * @return the encrypted byte sequence
123: * @throws Exception
124: */
125: public String encode64(byte[] secret) throws Exception;
126:
127: /** Decode a secret using the keystore password and PBEwithMD5andDES algo
128: * @param secret - the Util.tob64 string represention to decrypt
129: * @return the decrypted byte sequence
130: * @throws Exception
131: */
132: public byte[] decode64(String secret) throws Exception;
133: }
|