|
||||||||||
| 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
public abstract class AbstractEncryptionCli
Abstract base class for CLI handler of encryption operations.
| Field Summary | |
|---|---|
protected static String |
OPT_CIPHER
Cipher option. |
protected static String |
OPT_DECRYPT
Decrypt operation option. |
protected static String |
OPT_ENCODING
Cihpertext encoding format. |
protected static String |
OPT_ENCRYPT
Encrypt operation option. |
protected static String |
OPT_OUTFILE
Output file option. |
protected static String |
OPT_TAIL
Tail output option. |
| Fields inherited from class edu.vt.middleware.crypt.AbstractCli |
|---|
BASE_64_ENCODING, HEX_ENCODING, OPT_EXAMPLE, OPT_INFILE, options, PEM_SUFFIX |
| Constructor Summary | |
|---|---|
AbstractEncryptionCli()
|
|
| Method Summary | |
|---|---|
protected void |
decrypt(EncryptionAlgorithm alg,
InputStream in,
OutputStream out)
Decrypt the given ciphertext input stream into the output stream using the given encryption cipher algorithm. |
protected void |
encrypt(EncryptionAlgorithm alg,
InputStream in,
OutputStream out)
Encrypt the given plaintext input stream into the output stream using the given encryption cipher algorithm. |
protected InputStream |
getInputStream(org.apache.commons.cli.CommandLine line)
Get an input stream containing data to be encrypted or decrypted based on CLI arguments. |
protected OutputStream |
getOutputStream(org.apache.commons.cli.CommandLine line)
Get an output stream containing data to be encrypted or decrypted based on CLI arguments. |
protected void |
initOptions()
Initialize CLI options. |
| Methods inherited from class edu.vt.middleware.crypt.AbstractCli |
|---|
closeStream, closeStream, dispatch, getCommandName, 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_CIPHER
protected static final String OPT_OUTFILE
protected static final String OPT_ENCODING
protected static final String OPT_ENCRYPT
protected static final String OPT_DECRYPT
protected static final String OPT_TAIL
| Constructor Detail |
|---|
public AbstractEncryptionCli()
| Method Detail |
|---|
protected void initOptions()
initOptions in class AbstractCli
protected void encrypt(EncryptionAlgorithm alg,
InputStream in,
OutputStream out)
throws Exception
alg - Encryption cipher algorithm.in - Input stream containing plaintext.out - Output stream containing ciphertext.
Exception - On encryption errors.
protected void decrypt(EncryptionAlgorithm alg,
InputStream in,
OutputStream out)
throws Exception
alg - Encryption cipher algorithm.in - Input stream containing ciphertext.out - Output stream containing plaintext.
Exception - On encryption errors.
protected InputStream getInputStream(org.apache.commons.cli.CommandLine line)
throws IOException
getInputStream in class AbstractCliline - Parsed command line arguments container.
IOException - On stream creation errors.
protected OutputStream getOutputStream(org.apache.commons.cli.CommandLine line)
throws IOException
line - Parsed command line arguments container.
IOException - On stream creation errors.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||