* @param cmd Command line which capture all command line arguments
* @return CipherInformation object
*/
private static CipherInformation getCipherInformation(CommandLine cmd) {
CipherInformation information = new CipherInformation();
information.setAlgorithm(getArgument(cmd, ALGORITHM, CipherInformation.DEFAULT_ALGORITHM));
information.setCipherOperationMode(CipherOperationMode.valueOf(
getArgument(cmd, OP_MODE, CipherOperationMode.ENCRYPT.toString()).toUpperCase()));
String encInType = getArgument(cmd, IN_TYPE, null);
if (encInType != null) {
information.setInType(EncodingType.valueOf(encInType.toUpperCase()));
}
String encOutType = getArgument(cmd, OUT_TYPE, null);
if (encOutType != null) {
information.setOutType(EncodingType.valueOf(encOutType.toUpperCase()));
}
information.setType(getArgument(cmd, CIPHER_TYPE, null));
return information;
}