Package com.sun.grid.ca
Class GridCAImpl
java.lang.Object
com.sun.grid.ca.GridCAImpl
- All Implemented Interfaces:
GridCA
Default implementation of the
GridCA
Uses the sge_ca script which is delivered with gridengine to perform
actions on the gridengine ca.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
createDaemon
(String daemon, String user, String email) Create private key and certificate for a sdm daemon.createDaemonKeyStore
(String daemon) Get the keystore for a daemon.createKeyStore
(String username, char[] keystorePassword, char[] privateKeyPassword) Create a keystore which contains the private key and certificate of an user.protected Expect
createSGEDaemonKeyStore
(String daemon, char[] keystorePassword, char[] privateKeyPassword) Get the keystore for a SGE daemon.void
createUser
(String username, String email) Create private key and certificate for a user.void
createUser
(String username, String gecos, String email) Deprecated.the gecos field is no longer used, use @{link #createUser(String,String)} insteadprotected void
protected void
protected File
getCertFileForDaemon
(String daemon) protected File
getCertFileForUser
(String username) getCertificate
(String username) Get the X.509 certificate of a user.getDaemonCertificate
(String daemon) Get the X.509 certificate of a daemon.protected File
getLocalDaemonDir
(String daemon) protected File
getLocalUserDir
(String username) void
init
(InitCAParameters params) Initialize the gridengine ca.void
renewCaCertificate
(int days) Renew the certificate of the certificate authorityrenewCertificate
(String username, int days) Renew the certificate of a user.renewDaemonCertificate
(String daemon, int days) Renew the certificate of a daemon.
-
Constructor Details
-
GridCAImpl
Create a new instance ofGridCAImp
- Parameters:
config
- the configuration- Throws:
GridCAException
- if the configuration is not valid
-
-
Method Details
-
createProcess
-
init
Initialize the gridengine ca.- Specified by:
init
in interfaceGridCA
- Parameters:
params
- parmeters for the CA- Throws:
GridCAException
-
getLocalUserDir
-
getCertFileForUser
-
getLocalDaemonDir
-
getCertFileForDaemon
-
execute
- Throws:
GridCAException
-
execute
- Throws:
GridCAException
-
createUser
Deprecated.the gecos field is no longer used, use @{link #createUser(String,String)} insteadCreate private key and certificate for a user.- Specified by:
createUser
in 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
Create private key and certificate for a user.- Specified by:
createUser
in 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
Create private key and certificate for a sdm daemon.- Specified by:
createDaemon
in 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
Get the X.509 certificate of a user.- Specified by:
getCertificate
in interfaceGridCA
- Parameters:
username
- name of the user- Returns:
- X.509 certificate
- Throws:
GridCAException
- if the certificate does not exist
-
getDaemonCertificate
Get the X.509 certificate of a daemon.- Specified by:
getDaemonCertificate
in interfaceGridCA
- Parameters:
daemon
- name of the daemon- Returns:
- X.509 certificate
- Throws:
GridCAException
- if the certificate does not exist
-
renewCertificate
Renew the certificate of a user.- Specified by:
renewCertificate
in 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
Renew the certificate of a daemon.- Specified by:
renewDaemonCertificate
in 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
Description copied from interface:GridCA
Renew the certificate of the certificate authority- Specified by:
renewCaCertificate
in interfaceGridCA
- Parameters:
days
- validity of the new certificate in days- Throws:
GridCAException
- if the certificate can not be renewed
-
createKeyStore
public KeyStore createKeyStore(String username, char[] keystorePassword, char[] privateKeyPassword) throws GridCAException Create a keystore which contains the private key and certificate of an user.- Specified by:
createKeyStore
in 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
Get 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:
createDaemonKeyStore
in interfaceGridCA
- Parameters:
daemon
- name of the daemon- Returns:
- the keystore of the daemon
- Throws:
GridCAException
-
createSGEDaemonKeyStore
public KeyStore createSGEDaemonKeyStore(String daemon, char[] keystorePassword, char[] privateKeyPassword) throws GridCAException Get 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:
createSGEDaemonKeyStore
in 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
-