org.hardtokenmgmt.keyceremony.tolima
Class EJBCAKeyCeremony

java.lang.Object
  extended by org.hardtokenmgmt.keyceremony.tolima.BaseKeyCeremony
      extended by org.hardtokenmgmt.keyceremony.tolima.EJBCAKeyCeremony
Direct Known Subclasses:
TolimaStandardKeyCeremony

public abstract class EJBCAKeyCeremony
extends BaseKeyCeremony

Contains EJBCA specific base methods that can be used during key ceremony.

Version:
$Id$
Author:
Philip Vendil 26 jan 2008

Field Summary
protected  org.ejbca.core.model.log.Admin administrator
           
protected  java.lang.String jbossHome
           
 
Fields inherited from class org.hardtokenmgmt.keyceremony.tolima.BaseKeyCeremony
console, out, props
 
Constructor Summary
EJBCAKeyCeremony()
           
 
Method Summary
protected  int addEndEntityCertificateProfile(java.lang.String name, java.util.List<java.lang.Integer> availableCAIds)
          Method a end entity certificate profile by importing the XML data and adding it.
protected  int addEndEntityProfile(java.lang.String name, java.lang.String organizationName, java.lang.String caids, int defaultca, java.lang.String certprofiles, int defaultcertprofile)
          Method creating a end entity profile from file.
protected  java.lang.String addSuperAdministrator(java.lang.String username, int cAId, java.lang.String organizationName, int certificateProfileId, int endEntityProfileId)
          Method adding one super administrator
protected  int addSuperAdminsEndEntityCertificateProfile(java.lang.String name, java.util.List<java.lang.Integer> availableCAs)
           
protected  void configureAutomaticCRLGeneration()
          Configures service for automatic CRL generation.
protected  void configureMailSettingXML(java.lang.String sMTPHost)
           
protected  int createCA(java.lang.String hostName, java.lang.String cAName, int certProfileId, java.lang.String dN, java.lang.String validity, java.lang.String policyId, java.lang.String cRLPeriod, java.lang.String cRLIssuerInterval, java.lang.String cRLOverlapTime, boolean oCSPEnabled)
          Method used to create a CA in the system.
protected  boolean existsAdminGroup(java.lang.String groupName)
           
protected  void exportCACertificate(java.lang.String cAName)
          Exports the given CA to a 'cacerts' directory in PEM format.
protected  org.ejbca.core.model.ca.catoken.CATokenInfo genCATokenInfo(java.lang.String cAName)
          Method that generates CAToken info depending on the configured CATokenInfo implementation.
protected  org.ejbca.core.ejb.authorization.IAuthorizationSessionRemote getAuthorizationSessionRemote()
           
protected  org.ejbca.core.ejb.ca.caadmin.ICAAdminSessionRemote getCAAdminSessionRemote()
           
protected  org.ejbca.core.ejb.ca.store.ICertificateStoreSessionRemote getCertificateStoreSession()
           
protected  java.lang.String getKeyStoreDir()
          Gets the key store directory or creates it if it doesn't exists.
protected  org.ejbca.core.ejb.ra.raadmin.IRaAdminSessionRemote getRAAdminSessionRemote()
           
protected  org.ejbca.core.ejb.ra.IUserAdminSessionRemote getUserAdminSessionRemote()
           
protected  void parseAndStoreServerXML()
           
protected  void setInitialContext()
          Help method that sets up the RMI initial context.
 
Methods inherited from class org.hardtokenmgmt.keyceremony.tolima.BaseKeyCeremony
getConfirmation, initProps, out, readLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

administrator

protected org.ejbca.core.model.log.Admin administrator

jbossHome

protected final java.lang.String jbossHome
Constructor Detail

EJBCAKeyCeremony

public EJBCAKeyCeremony()
Method Detail

createCA

protected int createCA(java.lang.String hostName,
                       java.lang.String cAName,
                       int certProfileId,
                       java.lang.String dN,
                       java.lang.String validity,
                       java.lang.String policyId,
                       java.lang.String cRLPeriod,
                       java.lang.String cRLIssuerInterval,
                       java.lang.String cRLOverlapTime,
                       boolean oCSPEnabled)
                throws java.lang.Exception
Method used to create a CA in the system.

Parameters:
cAName - name of the CA
dN - distinguished name of the CA
validity - in days
policyId - used or null for no policy Id
cRLPeriod - in hours
cRLIssuerInterval - in minutes
cRLOverlapTime - in minutes
Returns:
the CAId of the created CA
Throws:
java.lang.Exception

genCATokenInfo

protected org.ejbca.core.model.ca.catoken.CATokenInfo genCATokenInfo(java.lang.String cAName)
                                                              throws java.lang.Exception
Method that generates CAToken info depending on the configured CATokenInfo implementation.

Throws:
java.lang.Exception

addEndEntityCertificateProfile

protected int addEndEntityCertificateProfile(java.lang.String name,
                                             java.util.List<java.lang.Integer> availableCAIds)
                                      throws java.lang.Exception
Method a end entity certificate profile by importing the XML data and adding it.

Throws:
java.lang.Exception

addSuperAdminsEndEntityCertificateProfile

protected int addSuperAdminsEndEntityCertificateProfile(java.lang.String name,
                                                        java.util.List<java.lang.Integer> availableCAs)
                                                 throws java.lang.Exception
Throws:
java.lang.Exception

addEndEntityProfile

protected int addEndEntityProfile(java.lang.String name,
                                  java.lang.String organizationName,
                                  java.lang.String caids,
                                  int defaultca,
                                  java.lang.String certprofiles,
                                  int defaultcertprofile)
                           throws java.lang.Exception
Method creating a end entity profile from file.

Parameters:
name - the name of the end entity profile to add.
caids - the caid that should be available
defaultca - the ca that should be default
certprofiles - available certificate profiles
defaultcertprofile - certificate profile hat should be default.
Returns:
id of newly created end entity profile.
Throws:
java.lang.Exception

addSuperAdministrator

protected java.lang.String addSuperAdministrator(java.lang.String username,
                                                 int cAId,
                                                 java.lang.String organizationName,
                                                 int certificateProfileId,
                                                 int endEntityProfileId)
                                          throws java.lang.Exception
Method adding one super administrator

Throws:
java.lang.Exception

existsAdminGroup

protected boolean existsAdminGroup(java.lang.String groupName)
                            throws java.lang.Exception
Throws:
java.lang.Exception

parseAndStoreServerXML

protected void parseAndStoreServerXML()
                               throws java.io.IOException
Throws:
java.io.IOException

configureMailSettingXML

protected void configureMailSettingXML(java.lang.String sMTPHost)
                                throws java.io.IOException
Throws:
java.io.IOException

getKeyStoreDir

protected java.lang.String getKeyStoreDir()
                                   throws java.io.IOException
Gets the key store directory or creates it if it doesn't exists.

Throws:
java.io.IOException

configureAutomaticCRLGeneration

protected void configureAutomaticCRLGeneration()
                                        throws java.lang.Exception
Configures service for automatic CRL generation.

Throws:
java.lang.Exception

exportCACertificate

protected void exportCACertificate(java.lang.String cAName)
                            throws java.lang.Exception
Exports the given CA to a 'cacerts' directory in PEM format. The directory is created if it doesn't exists.

Throws:
java.lang.Exception

getCertificateStoreSession

protected org.ejbca.core.ejb.ca.store.ICertificateStoreSessionRemote getCertificateStoreSession()
                                                                                         throws java.lang.Exception
Throws:
java.lang.Exception

getCAAdminSessionRemote

protected org.ejbca.core.ejb.ca.caadmin.ICAAdminSessionRemote getCAAdminSessionRemote()
                                                                               throws java.lang.Exception
Throws:
java.lang.Exception

getRAAdminSessionRemote

protected org.ejbca.core.ejb.ra.raadmin.IRaAdminSessionRemote getRAAdminSessionRemote()
                                                                               throws java.lang.Exception
Throws:
java.lang.Exception

getUserAdminSessionRemote

protected org.ejbca.core.ejb.ra.IUserAdminSessionRemote getUserAdminSessionRemote()
                                                                           throws java.lang.Exception
Throws:
java.lang.Exception

getAuthorizationSessionRemote

protected org.ejbca.core.ejb.authorization.IAuthorizationSessionRemote getAuthorizationSessionRemote()
                                                                                              throws java.lang.Exception
Throws:
java.lang.Exception

setInitialContext

protected void setInitialContext()
                          throws javax.naming.NamingException
Help method that sets up the RMI initial context.

Throws:
javax.naming.NamingException