|
||||||||||
| 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.signature.SignatureCli
public class SignatureCli
Command line interface for cryptographic signature operations.
| Field Summary | |
|---|---|
protected static String |
OPT_ALG
Signature algorithm option. |
protected static String |
OPT_DIGEST
Message digest used to produce encoded message to sign. |
protected static String |
OPT_ENCODING
Output encoding format. |
protected static String |
OPT_KEY
Path to key used for signing or verification. |
protected static String |
OPT_SIGN
Sign operation option. |
protected static String |
OPT_VERIFY
Verify operation option. |
| Fields inherited from class edu.vt.middleware.crypt.AbstractCli |
|---|
BASE_64_ENCODING, HEX_ENCODING, OPT_EXAMPLE, OPT_INFILE, options, PEM_SUFFIX |
| Constructor Summary | |
|---|---|
SignatureCli()
|
|
| 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 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 SignatureAlgorithm |
newInstance(org.apache.commons.cli.CommandLine line)
Creates a new signature algorithm instance based on command line args. |
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 byte[] |
readSignature(org.apache.commons.cli.CommandLine line)
Reads a cryptographic signature from a file, possibly in encoded format, and returns the result as the raw signature bytes. |
protected void |
sign(org.apache.commons.cli.CommandLine line)
Perform a signature operation on input data. |
protected void |
validateOptions(org.apache.commons.cli.CommandLine line)
Validates the existence of required options for an operation. |
protected void |
verify(org.apache.commons.cli.CommandLine line)
Perform a verification operation on input data. |
| 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 |
|---|
protected static final String OPT_ALG
protected static final String OPT_ENCODING
protected static final String OPT_DIGEST
protected static final String OPT_KEY
protected static final String OPT_SIGN
protected static final String OPT_VERIFY
| Constructor Detail |
|---|
public SignatureCli()
| 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 String getCommandName()
getCommandName in class AbstractCliprotected SignatureAlgorithm newInstance(org.apache.commons.cli.CommandLine line)
line - Parsed command line arguments container.
protected void sign(org.apache.commons.cli.CommandLine line)
throws Exception
line - Parsed command line arguments container.
Exception - On sign errors.
protected void verify(org.apache.commons.cli.CommandLine line)
throws Exception
line - Parsed command line arguments container.
Exception - On sign 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 byte[] readSignature(org.apache.commons.cli.CommandLine line)
throws IOException
line - Parsed command line arguments container.
IOException - On read 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 | |||||||||