|
||||||||||
| 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.AbstractEncryptionCli
edu.vt.middleware.crypt.asymmetric.AsymmetricCli
public class AsymmetricCli
Command line interface for asymmetric encryption operations.
| Field Summary | |
|---|---|
protected static String |
OPT_GENKEYPAIR
Generate key pair option. |
protected static String |
OPT_PRIVKEYPATH
Output path of private key for keypair generation option. |
| Fields inherited from class edu.vt.middleware.crypt.AbstractEncryptionCli |
|---|
OPT_CIPHER, OPT_DECRYPT, OPT_ENCODING, OPT_ENCRYPT, OPT_OUTFILE, OPT_TAIL |
| Fields inherited from class edu.vt.middleware.crypt.AbstractCli |
|---|
BASE_64_ENCODING, HEX_ENCODING, OPT_EXAMPLE, OPT_INFILE, options, PEM_SUFFIX |
| Constructor Summary | |
|---|---|
AsymmetricCli()
|
|
| Method Summary | |
|---|---|
protected void |
decrypt(org.apache.commons.cli.CommandLine line)
Perform a decryption operation using data specified on the command line. |
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 |
encrypt(org.apache.commons.cli.CommandLine line)
Perform an encryption operation using data specified on the command line. |
protected void |
genKeyPair(org.apache.commons.cli.CommandLine line)
Generate a new encryption public/private key pair using CLI arguments. |
protected String |
getCommandName()
Gets the name of the command for which this class provides a CLI interface. |
protected void |
initOptions()
Initialize CLI options. |
static void |
main(String[] args)
CLI entry point method. |
protected AsymmetricAlgorithm |
newAlgorithm(org.apache.commons.cli.CommandLine line)
Creates a new asymmetric encryption algorithm instance based on CLI options. |
protected PrivateKey |
readPrivateKey(org.apache.commons.cli.CommandLine line)
Creates a private key from a file defined by CLI arguments. |
protected PublicKey |
readPublicKey(org.apache.commons.cli.CommandLine line)
Creates a public key from a file defined by CLI 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.AbstractEncryptionCli |
|---|
decrypt, encrypt, getInputStream, getOutputStream |
| Methods inherited from class edu.vt.middleware.crypt.AbstractCli |
|---|
closeStream, closeStream, getInputStream, performAction, printExamples, printHelp |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String OPT_GENKEYPAIR
protected static final String OPT_PRIVKEYPATH
| Constructor Detail |
|---|
public AsymmetricCli()
| Method Detail |
|---|
public static void main(String[] args)
args - Command line arguments.protected void initOptions()
initOptions in class AbstractEncryptionCli
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 AsymmetricAlgorithm newAlgorithm(org.apache.commons.cli.CommandLine line)
line - Parsed command line arguments container.
protected String getCommandName()
getCommandName in class AbstractCli
protected void encrypt(org.apache.commons.cli.CommandLine line)
throws Exception
line - Parsed command line arguments container.
Exception - On encryption errors.
protected void decrypt(org.apache.commons.cli.CommandLine line)
throws Exception
line - Parsed command line arguments container.
Exception - On encryption errors.
protected void genKeyPair(org.apache.commons.cli.CommandLine line)
throws Exception
line - Parsed command line arguments container.
Exception - On encryption errors.
protected PublicKey readPublicKey(org.apache.commons.cli.CommandLine line)
throws Exception
line - Parsed command line arguments container.
Exception - On IO or key format errors.
protected PrivateKey readPrivateKey(org.apache.commons.cli.CommandLine line)
throws CryptException,
IOException
line - Parsed command line arguments container.
CryptException - On crypto errors.
IOException - On I/O 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 | |||||||||