org.apache.geronimo.security.ca
Class FileCertificateStore

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

public class FileCertificateStore
extends Object
implements CertificateStore, GBeanLifecycle

A certificate store implementation using disk files.


Field Summary
static GBeanInfo GBEAN_INFO
           
 
Constructor Summary
FileCertificateStore(ServerInfo serverInfo, URI directoryPath, Kernel kernel, 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()
          Fails the GBean.
 void doStart()
          Starts the GBean.
 void doStop()
          Stops the target.
 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 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 GBeanInfo GBEAN_INFO
Constructor Detail

FileCertificateStore

public FileCertificateStore(ServerInfo serverInfo,
                            URI directoryPath,
                            Kernel kernel,
                            AbstractName abstractName)
Constructor

Parameters:
storeDir - directory for the certificate store
Method Detail

storeCertificate

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

Specified by:
storeCertificate in interface CertificateStore
Parameters:
cert - Certificate to be stored
Throws:
CertificateStoreException

getCertificate

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

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

getCertificateBase64Text

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

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

getHighestSerialNumber

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

Specified by:
getHighestSerialNumber in interface CertificateStore
Throws:
CertificateStoreException

getNextSerialNumber

public BigInteger getNextSerialNumber()
                               throws 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 CertificateStore
Throws:
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 CertificateStore
Parameters:
sNo - Serial number of the certificate to be checked

storeCACertificate

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

Specified by:
storeCACertificate in interface CertificateStore
Parameters:
cert - CA's certificate
Throws:
CertificateStoreException

getCACertificate

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

Specified by:
getCACertificate in interface CertificateStore
Throws:
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 CertificateStore
Parameters:
sNo - Serial number of the certificate
challenge - Challenge phrase

doFail

public void doFail()
Description copied from interface: GBeanLifecycle
Fails the GBean. This informs the GBean that it is about to transition to the failed state.

Specified by:
doFail in interface GBeanLifecycle

doStart

public void doStart()
             throws Exception
Description copied from interface: GBeanLifecycle
Starts the GBean. This informs the GBean that it is about to transition to the running state.

Specified by:
doStart in interface GBeanLifecycle
Throws:
Exception - if the target failed to start; this will cause a transition to the failed state

doStop

public void doStop()
            throws Exception
Description copied from interface: GBeanLifecycle
Stops the target. This informs the GBean that it is about to transition to the stopped state.

Specified by:
doStop in interface GBeanLifecycle
Throws:
Exception - if the target failed to stop; this will cause a transition to the failed state

getGBeanInfo

public static GBeanInfo getGBeanInfo()


Copyright © 2003-2008 The Apache Geronimo development community. All Rights Reserved.