org.apache.geronimo.security.keystore
Class FileKeystoreInstance

java.lang.Object
  extended byorg.apache.geronimo.security.keystore.FileKeystoreInstance
All Implemented Interfaces:
org.apache.geronimo.gbean.GBeanLifecycle, org.apache.geronimo.management.geronimo.KeystoreInstance

public class FileKeystoreInstance
extends Object
implements org.apache.geronimo.management.geronimo.KeystoreInstance, org.apache.geronimo.gbean.GBeanLifecycle

Implementation of KeystoreInstance that accesses a keystore file on the local filesystem, identified by the file's name (the last component of the name only, not the full path).

Version:
$Rev: 409817 $ $Date: 2006-05-27 09:56:38 +0200 (Sat, 27 May 2006) $

Field Summary
static org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
           
 
Constructor Summary
FileKeystoreInstance(org.apache.geronimo.system.serverinfo.ServerInfo serverInfo, URI keystorePath, String keystoreName, String keystorePassword, String keyPasswords, org.apache.geronimo.kernel.Kernel kernel, org.apache.geronimo.gbean.AbstractName abstractName)
           
 
Method Summary
 void doFail()
           
 void doStart()
           
 void doStop()
           
 boolean generateKeyPair(String alias, char[] storePassword, char[] keyPassword, String keyAlgorithm, int keySize, String signatureAlgorithm, int validity, String commonName, String orgUnit, String organization, String locality, String state, String country)
           
 Certificate getCertificate(String alias, char[] storePassword)
           
static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()
           
 KeyManager[] getKeyManager(String algorithm, String alias)
           
 String getKeystoreName()
           
 TrustManager[] getTrustManager(String algorithm)
           
 String[] getUnlockedKeys()
           
 boolean importTrustCertificate(Certificate cert, String alias, char[] storePassword)
           
 boolean isKeyLocked(String alias)
          Checks whether the specified private key is locked, which is to say, available for other components to use to generate socket factories.
 boolean isKeystoreLocked()
           
 boolean isTrustStore()
           
 String[] listPrivateKeys(char[] storePassword)
           
 String[] listTrustCertificates(char[] storePassword)
           
 void lockKeystore()
           
 void lockPrivateKey(String alias)
           
 void setKeyPasswords(String passwords)
           
 void setKeystorePassword(String password)
           
 boolean unlockKeystore(char[] password)
           
 boolean unlockPrivateKey(String alias, char[] password)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GBEAN_INFO

public static final org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
Constructor Detail

FileKeystoreInstance

public FileKeystoreInstance(org.apache.geronimo.system.serverinfo.ServerInfo serverInfo,
                            URI keystorePath,
                            String keystoreName,
                            String keystorePassword,
                            String keyPasswords,
                            org.apache.geronimo.kernel.Kernel kernel,
                            org.apache.geronimo.gbean.AbstractName abstractName)
Method Detail

doStart

public void doStart()
             throws Exception
Specified by:
doStart in interface org.apache.geronimo.gbean.GBeanLifecycle
Throws:
Exception

doStop

public void doStop()
            throws Exception
Specified by:
doStop in interface org.apache.geronimo.gbean.GBeanLifecycle
Throws:
Exception

doFail

public void doFail()
Specified by:
doFail in interface org.apache.geronimo.gbean.GBeanLifecycle

getKeystoreName

public String getKeystoreName()
Specified by:
getKeystoreName in interface org.apache.geronimo.management.geronimo.KeystoreInstance

unlockKeystore

public boolean unlockKeystore(char[] password)
Specified by:
unlockKeystore in interface org.apache.geronimo.management.geronimo.KeystoreInstance

setKeystorePassword

public void setKeystorePassword(String password)

lockKeystore

public void lockKeystore()
Specified by:
lockKeystore in interface org.apache.geronimo.management.geronimo.KeystoreInstance

isKeystoreLocked

public boolean isKeystoreLocked()
Specified by:
isKeystoreLocked in interface org.apache.geronimo.management.geronimo.KeystoreInstance

listPrivateKeys

public String[] listPrivateKeys(char[] storePassword)
Specified by:
listPrivateKeys in interface org.apache.geronimo.management.geronimo.KeystoreInstance

unlockPrivateKey

public boolean unlockPrivateKey(String alias,
                                char[] password)
                         throws org.apache.geronimo.management.geronimo.KeystoreIsLocked
Specified by:
unlockPrivateKey in interface org.apache.geronimo.management.geronimo.KeystoreInstance
Throws:
org.apache.geronimo.management.geronimo.KeystoreIsLocked

getUnlockedKeys

public String[] getUnlockedKeys()
                         throws org.apache.geronimo.management.geronimo.KeystoreIsLocked
Specified by:
getUnlockedKeys in interface org.apache.geronimo.management.geronimo.KeystoreInstance
Throws:
org.apache.geronimo.management.geronimo.KeystoreIsLocked

isTrustStore

public boolean isTrustStore()
                     throws org.apache.geronimo.management.geronimo.KeystoreIsLocked
Specified by:
isTrustStore in interface org.apache.geronimo.management.geronimo.KeystoreInstance
Throws:
org.apache.geronimo.management.geronimo.KeystoreIsLocked

lockPrivateKey

public void lockPrivateKey(String alias)
Specified by:
lockPrivateKey in interface org.apache.geronimo.management.geronimo.KeystoreInstance

setKeyPasswords

public void setKeyPasswords(String passwords)

isKeyLocked

public boolean isKeyLocked(String alias)
Checks whether the specified private key is locked, which is to say, available for other components to use to generate socket factories. Does not check whether the unlock password is actually correct.

Specified by:
isKeyLocked in interface org.apache.geronimo.management.geronimo.KeystoreInstance

listTrustCertificates

public String[] listTrustCertificates(char[] storePassword)
Specified by:
listTrustCertificates in interface org.apache.geronimo.management.geronimo.KeystoreInstance

getCertificate

public Certificate getCertificate(String alias,
                                  char[] storePassword)
Specified by:
getCertificate in interface org.apache.geronimo.management.geronimo.KeystoreInstance

importTrustCertificate

public boolean importTrustCertificate(Certificate cert,
                                      String alias,
                                      char[] storePassword)
Specified by:
importTrustCertificate in interface org.apache.geronimo.management.geronimo.KeystoreInstance

generateKeyPair

public boolean generateKeyPair(String alias,
                               char[] storePassword,
                               char[] keyPassword,
                               String keyAlgorithm,
                               int keySize,
                               String signatureAlgorithm,
                               int validity,
                               String commonName,
                               String orgUnit,
                               String organization,
                               String locality,
                               String state,
                               String country)
Specified by:
generateKeyPair in interface org.apache.geronimo.management.geronimo.KeystoreInstance

getKeyManager

public KeyManager[] getKeyManager(String algorithm,
                                  String alias)
                           throws NoSuchAlgorithmException,
                                  UnrecoverableKeyException,
                                  KeyStoreException,
                                  org.apache.geronimo.management.geronimo.KeystoreIsLocked
Specified by:
getKeyManager in interface org.apache.geronimo.management.geronimo.KeystoreInstance
Throws:
NoSuchAlgorithmException
UnrecoverableKeyException
KeyStoreException
org.apache.geronimo.management.geronimo.KeystoreIsLocked

getTrustManager

public TrustManager[] getTrustManager(String algorithm)
                               throws KeyStoreException,
                                      NoSuchAlgorithmException,
                                      org.apache.geronimo.management.geronimo.KeystoreIsLocked
Specified by:
getTrustManager in interface org.apache.geronimo.management.geronimo.KeystoreInstance
Throws:
KeyStoreException
NoSuchAlgorithmException
org.apache.geronimo.management.geronimo.KeystoreIsLocked

getGBeanInfo

public static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.