org.apache.geronimo.security.ca
Class FileCertificateStore

java.lang.Object
  extended by org.apache.geronimo.security.ca.FileCertificateStore
All Implemented Interfaces:
org.apache.geronimo.gbean.GBeanLifecycle, org.apache.geronimo.management.geronimo.CertificateStore

public class FileCertificateStore
extends Object
implements org.apache.geronimo.management.geronimo.CertificateStore, org.apache.geronimo.gbean.GBeanLifecycle

A certificate store implementation using disk files.


Field Summary
static org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
           
 
Constructor Summary
FileCertificateStore(org.apache.geronimo.system.serverinfo.ServerInfo serverInfo, URI directoryPath, org.apache.geronimo.kernel.Kernel kernel, org.apache.geronimo.gbean.AbstractName abstractName)
          Constructor
 
Method Summary
 boolean containsCertificate(BigInteger sNo)
          This method checks if a certificate with a given serial number exists in the store.
 void doFail()
           
 void doStart()
           
 void doStop()
           
 Certificate getCACertificate()
          This method returns the CA's certificate stored in the store.
 Certificate getCertificate(BigInteger sNo)
          This method returns a Certificate with a given serial number (if it exists in the store)
 String getCertificateBase64Text(BigInteger sNo)
          This method returns base64 encoded certificate with a given serial number (if it exists in the store)
static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()
           
 BigInteger getHighestSerialNumber()
          This method returns the highest certificate serial number in the store.
 BigInteger getNextSerialNumber()
          This method returns the 'highest certificate serial number plus ONE' and increments the highest serial number in the store.
 boolean setCertificateChallenge(BigInteger sNo, String challenge)
          This method stores the challenge phrase against the specified certificate serial number
 boolean storeCACertificate(Certificate cert)
          This method stores the CA's certificate in the store.
 void storeCertificate(Certificate cert)
          This method stores a given certificate.
 
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

FileCertificateStore

public FileCertificateStore(org.apache.geronimo.system.serverinfo.ServerInfo serverInfo,
                            URI directoryPath,
                            org.apache.geronimo.kernel.Kernel kernel,
                            org.apache.geronimo.gbean.AbstractName abstractName)
Constructor

Parameters:
storeDir - directory for the certificate store
Method Detail

storeCertificate

public void storeCertificate(Certificate cert)
                      throws org.apache.geronimo.management.geronimo.CertificateStoreException
This method stores a given certificate.

Specified by:
storeCertificate in interface org.apache.geronimo.management.geronimo.CertificateStore
Parameters:
cert - Certificate to be stored
Throws:
org.apache.geronimo.management.geronimo.CertificateStoreException

getCertificate

public Certificate getCertificate(BigInteger sNo)
                           throws org.apache.geronimo.management.geronimo.CertificateStoreException
This method returns a Certificate with a given serial number (if it exists in the store)

Specified by:
getCertificate in interface org.apache.geronimo.management.geronimo.CertificateStore
Parameters:
sNo - Serial Number of the certificate to be retrieved.
Throws:
org.apache.geronimo.management.geronimo.CertificateStoreException

getCertificateBase64Text

public String getCertificateBase64Text(BigInteger sNo)
                                throws org.apache.geronimo.management.geronimo.CertificateStoreException
This method returns base64 encoded certificate with a given serial number (if it exists in the store)

Specified by:
getCertificateBase64Text in interface org.apache.geronimo.management.geronimo.CertificateStore
Parameters:
sNo - Serial Number of the certificate to be retrieved.
Throws:
org.apache.geronimo.management.geronimo.CertificateStoreException

getHighestSerialNumber

public BigInteger getHighestSerialNumber()
                                  throws org.apache.geronimo.management.geronimo.CertificateStoreException
This method returns the highest certificate serial number in the store.

Specified by:
getHighestSerialNumber in interface org.apache.geronimo.management.geronimo.CertificateStore
Throws:
org.apache.geronimo.management.geronimo.CertificateStoreException

getNextSerialNumber

public BigInteger getNextSerialNumber()
                               throws org.apache.geronimo.management.geronimo.CertificateStoreException
This method returns the 'highest certificate serial number plus ONE' and increments the highest serial number in the store.

Specified by:
getNextSerialNumber in interface org.apache.geronimo.management.geronimo.CertificateStore
Throws:
org.apache.geronimo.management.geronimo.CertificateStoreException

containsCertificate

public boolean containsCertificate(BigInteger sNo)
This method checks if a certificate with a given serial number exists in the store.

Specified by:
containsCertificate in interface org.apache.geronimo.management.geronimo.CertificateStore
Parameters:
sNo - Serial number of the certificate to be checked

storeCACertificate

public boolean storeCACertificate(Certificate cert)
                           throws org.apache.geronimo.management.geronimo.CertificateStoreException
This method stores the CA's certificate in the store.

Specified by:
storeCACertificate in interface org.apache.geronimo.management.geronimo.CertificateStore
Parameters:
cert - CA's certificate
Throws:
org.apache.geronimo.management.geronimo.CertificateStoreException

getCACertificate

public Certificate getCACertificate()
                             throws org.apache.geronimo.management.geronimo.CertificateStoreException
This method returns the CA's certificate stored in the store.

Specified by:
getCACertificate in interface org.apache.geronimo.management.geronimo.CertificateStore
Throws:
org.apache.geronimo.management.geronimo.CertificateStoreException

setCertificateChallenge

public boolean setCertificateChallenge(BigInteger sNo,
                                       String challenge)
This method stores the challenge phrase against the specified certificate serial number

Specified by:
setCertificateChallenge in interface org.apache.geronimo.management.geronimo.CertificateStore
Parameters:
sNo - Serial number of the certificate
challenge - Challenge phrase

doFail

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

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

getGBeanInfo

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


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