Package com.sun.grid.ca
Class GridCAImpl
- java.lang.Object
-
- com.sun.grid.ca.GridCAImpl
-
-
Constructor Summary
Constructors Constructor Description GridCAImpl(GridCAConfiguration config)Create a new instance ofGridCAImp
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcreateDaemon(java.lang.String daemon, java.lang.String user, java.lang.String email)Create private key and certificate for a sdm daemon.java.security.KeyStorecreateDaemonKeyStore(java.lang.String daemon)Get the keystore for a daemon.java.security.KeyStorecreateKeyStore(java.lang.String username, char[] keystorePassword, char[] privateKeyPassword)Create a keystore which contains the private key and certificate of an user.protected ExpectcreateProcess()java.security.KeyStorecreateSGEDaemonKeyStore(java.lang.String daemon, char[] keystorePassword, char[] privateKeyPassword)Get the keystore for a SGE daemon.voidcreateUser(java.lang.String username, java.lang.String email)Create private key and certificate for a user.voidcreateUser(java.lang.String username, java.lang.String gecos, java.lang.String email)Deprecated.the gecos field is no longer used, use @{link #createUser(String,String)} insteadprotected voidexecute(Expect pb)protected voidexecute(Expect pb, boolean setLock)protected java.io.FilegetCertFileForDaemon(java.lang.String daemon)protected java.io.FilegetCertFileForUser(java.lang.String username)java.security.cert.X509CertificategetCertificate(java.lang.String username)Get the X.509 certificate of a user.java.security.cert.X509CertificategetDaemonCertificate(java.lang.String daemon)Get the X.509 certificate of a daemon.protected java.io.FilegetLocalDaemonDir(java.lang.String daemon)protected java.io.FilegetLocalUserDir(java.lang.String username)voidinit(InitCAParameters params)Initialize the gridengine ca.voidrenewCaCertificate(int days)Renew the certificate of the certificate authorityjava.security.cert.X509CertificaterenewCertificate(java.lang.String username, int days)Renew the certificate of a user.java.security.cert.X509CertificaterenewDaemonCertificate(java.lang.String daemon, int days)Renew the certificate of a daemon.
-
-
-
Constructor Detail
-
GridCAImpl
public GridCAImpl(GridCAConfiguration config) throws GridCAException
Create a new instance ofGridCAImp- Parameters:
config- the configuration- Throws:
GridCAException- if the configuration is not valid
-
-
Method Detail
-
createProcess
protected Expect createProcess()
-
init
public void init(InitCAParameters params) throws GridCAException
Initialize the gridengine ca.- Specified by:
initin interfaceGridCA- Parameters:
params- parmeters for the CA- Throws:
GridCAException
-
getLocalUserDir
protected java.io.File getLocalUserDir(java.lang.String username)
-
getCertFileForUser
protected java.io.File getCertFileForUser(java.lang.String username)
-
getLocalDaemonDir
protected java.io.File getLocalDaemonDir(java.lang.String daemon)
-
getCertFileForDaemon
protected java.io.File getCertFileForDaemon(java.lang.String daemon)
-
execute
protected void execute(Expect pb) throws GridCAException
- Throws:
GridCAException
-
execute
protected void execute(Expect pb, boolean setLock) throws GridCAException
- Throws:
GridCAException
-
createUser
public void createUser(java.lang.String username, java.lang.String gecos, java.lang.String email) throws GridCAExceptionDeprecated.the gecos field is no longer used, use @{link #createUser(String,String)} insteadCreate private key and certificate for a user.- Specified by:
createUserin interfaceGridCA- Parameters:
username- name of the usergecos- gecos field of the useremail- email address of the user- Throws:
GridCAException- if the creation of the private key or the certificate fails
-
createUser
public void createUser(java.lang.String username, java.lang.String email) throws GridCAExceptionCreate private key and certificate for a user.- Specified by:
createUserin interfaceGridCA- Parameters:
username- name of the useremail- email address of the user- Throws:
GridCAException- if the creation of the private key or the certificate fails
-
createDaemon
public void createDaemon(java.lang.String daemon, java.lang.String user, java.lang.String email) throws GridCAExceptionCreate private key and certificate for a sdm daemon.- Specified by:
createDaemonin interfaceGridCA- Parameters:
daemon- name of the daemonuser- username of the daemon (owner of the process)email- email address of the process owner- Throws:
GridCAException- if the create of the daemon failed
-
getCertificate
public java.security.cert.X509Certificate getCertificate(java.lang.String username) throws GridCAExceptionGet the X.509 certificate of a user.- Specified by:
getCertificatein interfaceGridCA- Parameters:
username- name of the user- Returns:
- X.509 certificate
- Throws:
GridCAException- if the certificate does not exist
-
getDaemonCertificate
public java.security.cert.X509Certificate getDaemonCertificate(java.lang.String daemon) throws GridCAExceptionGet the X.509 certificate of a daemon.- Specified by:
getDaemonCertificatein interfaceGridCA- Parameters:
daemon- name of the daemon- Returns:
- X.509 certificate
- Throws:
GridCAException- if the certificate does not exist
-
renewCertificate
public java.security.cert.X509Certificate renewCertificate(java.lang.String username, int days) throws GridCAExceptionRenew the certificate of a user.- Specified by:
renewCertificatein interfaceGridCA- Parameters:
username- name of the userdays- validity of the new certificate in days- Returns:
- the renewed certificate
- Throws:
GridCAException- if the certificate can not be renewed
-
renewDaemonCertificate
public java.security.cert.X509Certificate renewDaemonCertificate(java.lang.String daemon, int days) throws GridCAExceptionRenew the certificate of a daemon.- Specified by:
renewDaemonCertificatein interfaceGridCA- Parameters:
daemon- name of the daemondays- validity of the new certificate in days- Returns:
- the renewed certificate
- Throws:
GridCAException- if the certificate can not be renewed
-
renewCaCertificate
public void renewCaCertificate(int days) throws GridCAExceptionDescription copied from interface:GridCARenew the certificate of the certificate authority- Specified by:
renewCaCertificatein interfaceGridCA- Parameters:
days- validity of the new certificate in days- Throws:
GridCAException- if the certificate can not be renewed
-
createKeyStore
public java.security.KeyStore createKeyStore(java.lang.String username, char[] keystorePassword, char[] privateKeyPassword) throws GridCAExceptionCreate a keystore which contains the private key and certificate of an user.- Specified by:
createKeyStorein interfaceGridCA- Parameters:
username- name of the userkeystorePassword- password used for encrypt the keystoreprivateKeyPassword- password for the private key- Returns:
- the keystore
- Throws:
GridCAException- if the keystore could not be created
-
createDaemonKeyStore
public java.security.KeyStore createDaemonKeyStore(java.lang.String daemon) throws GridCAExceptionGet the keystore for a daemon. This method can be used be the installation to create keystore for the daemon of a sdm system.- Specified by:
createDaemonKeyStorein interfaceGridCA- Parameters:
daemon- name of the daemon- Returns:
- the keystore of the daemon
- Throws:
GridCAException
-
createSGEDaemonKeyStore
public java.security.KeyStore createSGEDaemonKeyStore(java.lang.String daemon, char[] keystorePassword, char[] privateKeyPassword) throws GridCAExceptionGet the keystore for a SGE daemon. This method can be used be the installation to create keystore for the daemon of a sdm system.- Specified by:
createSGEDaemonKeyStorein interfaceGridCA- Parameters:
daemon- name of the daemonkeystorePassword- password used to encrypt the keystoreprivateKeyPassword- password used to encrypt the key- Returns:
- the keystore of the daemon
- Throws:
GridCAException
-
-