|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.crypt.AbstractCli
edu.vt.middleware.crypt.KeyStoreCli
public class KeyStoreCli
Command line interface for keystore operations.
| Field Summary | |
|---|---|
static String |
DEFAULT_KEY_ALGORITHM
Default key algorithm name. |
protected static String |
OPT_ALIAS
Option for specifying alias for keystore entry to import/export. |
protected static String |
OPT_CERT
Option for specifying certificate file to import/export. |
protected static String |
OPT_EXPORT
Option for exporting keypair from keystore. |
protected static String |
OPT_IMPORT
Option for importing keypair into keystore. |
protected static String |
OPT_KEY
Option for specifying key file to import/export. |
protected static String |
OPT_KEYALG
Option for specifying key cipher algorithm. |
protected static String |
OPT_LIST
Option for listing keystore contents. |
protected static String |
OPT_PASS
Option for specifying keystore password. |
protected static String |
OPT_STORE
Option for specifying keystore file. |
protected static String |
OPT_TYPE
Option for specifying keystore type. |
| Fields inherited from class edu.vt.middleware.crypt.AbstractCli |
|---|
BASE_64_ENCODING, HEX_ENCODING, OPT_EXAMPLE, OPT_INFILE, options, PEM_SUFFIX |
| Constructor Summary | |
|---|---|
KeyStoreCli()
|
|
| Method Summary | |
|---|---|
protected void |
dispatch(org.apache.commons.cli.CommandLine line)
Dispatch command line data to the handler that can perform the operation requested on the command line. |
protected void |
doExport(org.apache.commons.cli.CommandLine line)
Exports a certificate or key pair from the keystore. |
protected void |
doImport(org.apache.commons.cli.CommandLine line)
Imports a certificate or key pair into the keystore. |
protected String |
getCommandName()
Gets the name of the command for which this class provides a CLI interface. |
protected void |
initOptions()
Initialize CLI options. |
protected void |
list(org.apache.commons.cli.CommandLine line)
Lists keystore contents on STDOUT. |
static void |
main(String[] args)
CLI entry point method. |
protected void |
printCertificate(Certificate cert)
Prints a string representation of the given certificate to STDOUT. |
protected KeyStore |
readKeyStore(org.apache.commons.cli.CommandLine line)
Reads a keystore from disk using command line arguments. |
protected void |
validateOptions(org.apache.commons.cli.CommandLine line)
Validates the existence of required options for an operation. |
| Methods inherited from class edu.vt.middleware.crypt.AbstractCli |
|---|
closeStream, closeStream, getInputStream, getInputStream, performAction, printExamples, printHelp |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_KEY_ALGORITHM
protected static final String OPT_LIST
protected static final String OPT_IMPORT
protected static final String OPT_EXPORT
protected static final String OPT_STORE
protected static final String OPT_TYPE
protected static final String OPT_PASS
protected static final String OPT_ALIAS
protected static final String OPT_CERT
protected static final String OPT_KEY
protected static final String OPT_KEYALG
| Constructor Detail |
|---|
public KeyStoreCli()
| Method Detail |
|---|
public static void main(String[] args)
args - Command line arguments.protected void initOptions()
initOptions in class AbstractCli
protected void dispatch(org.apache.commons.cli.CommandLine line)
throws Exception
dispatch in class AbstractCliline - Parsed command line arguments container.
Exception - On errors thrown by handler.
protected void list(org.apache.commons.cli.CommandLine line)
throws Exception
line - Parsed command line arguments container.
Exception - On errors.
protected void doImport(org.apache.commons.cli.CommandLine line)
throws Exception
line - Parsed command line arguments container.
Exception - On errors.
protected void doExport(org.apache.commons.cli.CommandLine line)
throws Exception
line - Parsed command line arguments container.
Exception - On errors.protected String getCommandName()
getCommandName in class AbstractCli
protected KeyStore readKeyStore(org.apache.commons.cli.CommandLine line)
throws Exception
line - Parsed command line arguments container.
Exception - On errors.
protected void printCertificate(Certificate cert)
throws Exception
cert - Certificate to print.
Exception - On print errors.protected void validateOptions(org.apache.commons.cli.CommandLine line)
line - Parsed command line arguments container.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||