|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ourgrid.common.security.KeyToolWrapper
public class KeyToolWrapper
This class provides an abstraction to use the KeyTool features. The idea is to generate self-signed certificates, as well import and export signatures to the user KeyStore file. The keystore file is located at the $MGROOT/var/$USER.keys by deafult.
Field Summary | |
---|---|
protected static java.lang.String |
ALIAS
This option is used to specify an alias to identfy the certificate |
protected static java.lang.String |
DNAME
Option to specify personal information of the certificate |
protected Executor |
executor
To execute the KeyTool application |
static java.lang.String |
EXPORT
Export certificates from a KeyStore |
protected static java.lang.String |
FILE
Exported certificate file specification option |
static java.lang.String |
GENKEY
Generation a key entry option |
static java.lang.String |
IMPORT
Import certificates to the KeyStore option |
protected static java.lang.String |
KEYPASS
This option is used to specify a password associated to the generated Key |
protected static java.lang.String |
KEYSIZE
the keysize option that determines the size in bits of the generated key |
protected static java.lang.String |
KEYSTORE
Keystore file specification option |
protected static java.lang.String |
KEYTOOL
The keytool command line |
protected static java.lang.String |
LIST
This option is used to list KEYSTORE content |
protected static int |
MAXSIZE
Determine the maximum keysize supported by the KeyTool |
protected ExecutorResult |
result
Store the result of the execution of the KeyTool |
protected static java.lang.String |
STOREPASS
This option is used to specify a password associated to the KeyStore |
protected static java.lang.String |
VALIDITY
This option determines the validity of the certificate |
Constructor Summary | |
---|---|
KeyToolWrapper()
This method constructs a new instance of the |
Method Summary | |
---|---|
protected boolean |
aliasExists(java.lang.String alias,
java.lang.String keystoreName)
This method verifies the existence of the alias into the keystore. |
protected boolean |
execute(java.lang.String commandLine)
This method executes the key tool command that is determined by the public methods. |
boolean |
generateKey(java.lang.String alias,
java.lang.String commonName,
java.lang.String keystoreName,
int keysize,
int validity)
This method provides an interface to the key entry generation into the Keystore specified. |
boolean |
transportCertificate(java.lang.String alias,
java.lang.String keystoreName,
java.lang.String certificateFilename,
java.lang.String operation)
This method perform the key importation and exportation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int MAXSIZE
protected static final java.lang.String KEYTOOL
public static final java.lang.String GENKEY
public static final java.lang.String IMPORT
public static final java.lang.String EXPORT
protected static final java.lang.String KEYSTORE
protected static final java.lang.String FILE
protected static final java.lang.String KEYSIZE
protected static final java.lang.String VALIDITY
protected static final java.lang.String DNAME
protected static final java.lang.String STOREPASS
protected static final java.lang.String KEYPASS
protected static final java.lang.String ALIAS
protected static final java.lang.String LIST
protected Executor executor
protected ExecutorResult result
Constructor Detail |
---|
public KeyToolWrapper()
Method Detail |
---|
public boolean generateKey(java.lang.String alias, java.lang.String commonName, java.lang.String keystoreName, int keysize, int validity)
alias
- an alias to identify the certificatecommonName
- the CN field that is used to identify the key entry.keystoreName
- the filename where the key entries are stored.keysize
- the size of generated key in bytesvalidity
- how many days the key will be a valid key
public boolean transportCertificate(java.lang.String alias, java.lang.String keystoreName, java.lang.String certificateFilename, java.lang.String operation)
alias
- the identificator of the key that must be transportedkeystoreName
- the name of the file that store the certificatescertificateFilename
- the name of the file to/from the certificate
goes/comesoperation
- the operation that must be performed.
KeyToolWrapper.IMPORT and KeyToolWrapper.EXPORT
protected boolean aliasExists(java.lang.String alias, java.lang.String keystoreName)
alias
- The alias namekeystoreName
- The name of the file that stores the certificates
protected boolean execute(java.lang.String commandLine)
commandLine
- the command line that represents a key generation,
certificate importation or exportation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |