|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.knowcenter.wag.egov.egiz.commandline.Main
public abstract class Main
The main program entry point of the commandline tool.
| Field Summary | |
|---|---|
protected static String |
PARAMETER_CONNECTOR
Command line parameter setting the application to connect |
protected static String |
PARAMETER_MODE
Command line parameter setting the application mode sign|verify |
protected static String |
PARAMETER_POS
Command line parameter selecting the position of the signature. |
protected static String |
PARAMETER_SIGNATURE_MODE
Command line parameter setting the signature mode. |
protected static String |
PARAMETER_SIGNATURE_TYPE
Command line parameter setting the signature type. |
protected static String |
PARAMETER_USER_NAME
Command line parameter setting the username |
protected static String |
PARAMETER_USER_PASSWORD
Command line parameter setting the users password |
protected static String |
PARAMETER_VERIFY_WHICH
Command line parameter selecting the signature which is going to be verified. |
static String |
VALUE_MODE_SIGN
The application mode sign |
static String |
VALUE_MODE_VERIFY
The application mode verify |
static String |
VALUE_SIGNATURE_MODE_BINARY
The application mode sign |
static String |
VALUE_SIGNATURE_MODE_DETACHED
The application mode verify |
static String |
VALUE_SIGNATURE_MODE_TEXTUAL
The application mode verify |
| Constructor Summary | |
|---|---|
Main()
|
|
| Method Summary | |
|---|---|
protected static void |
carryOutCommand(String mode,
String signature_mode,
String connector,
String signature_type,
String user_name,
String user_password,
int verify_which,
String input,
String output,
String pos_string)
Carries out the actual command given via the commandline parameters. |
protected static boolean |
checkConnector(String connector)
Checks the value for correctness. |
protected static boolean |
checkMode(String mode)
Checks the value for correctness. |
protected static boolean |
checkSignatureMode(String signature_mode)
Checks the value for correctness. |
protected static boolean |
checkSignatureType(String signature_type)
Checks the value for correctness. |
static void |
formatSignatureResponse(SignatureResponse result,
PrintStream writer)
Formats the SignatureResponse. |
protected static void |
formatVerifyResults(List results,
PrintStream writer)
Formats the verification results. |
protected static String |
generateOutputFileNameFromInput(String input,
SignResult sign_result)
Generates a suitable output file name for the output regarding the type of the sign_result. |
static void |
main(String[] args)
Main program entry point. |
protected static void |
printErrorCodeException(ErrorCodeException ece)
Prints out the ErrorCodeException in a descriptive form. |
protected static void |
printMissing(String missing_term)
Prints that something is missing. |
protected static void |
printMissingParameter(String missing_term,
String parameter)
Prints that a certain parameter was missing. |
protected static void |
printNoValue(String parameter)
Prints that the provided value was unrecognized. |
protected static void |
printUnrecognizedAdditionalCommandlineArgument(String argument)
Prints that the provided additional commandline argument was unrecognized. |
protected static void |
printUnrecognizedOption(String option)
Prints that the provided option was unrecognized. |
protected static void |
printUnrecognizedValue(String parameter,
String value)
Prints that the provided value was unrecognized. |
static void |
printUsage(PrintStream writer)
Prints the usage text. |
protected static PdfASID |
translateSignatureModeToPdfASID(String signature_mode)
Translates the commandline argument to a PDF-AS-ID. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String PARAMETER_MODE
protected static final String PARAMETER_CONNECTOR
protected static final String PARAMETER_SIGNATURE_MODE
protected static final String PARAMETER_SIGNATURE_TYPE
protected static final String PARAMETER_USER_NAME
protected static final String PARAMETER_USER_PASSWORD
protected static final String PARAMETER_POS
protected static final String PARAMETER_VERIFY_WHICH
public static final String VALUE_MODE_SIGN
public static final String VALUE_MODE_VERIFY
public static final String VALUE_SIGNATURE_MODE_BINARY
public static final String VALUE_SIGNATURE_MODE_TEXTUAL
public static final String VALUE_SIGNATURE_MODE_DETACHED
| Constructor Detail |
|---|
public Main()
| Method Detail |
|---|
public static void main(String[] args)
throws IOException
args - The commandline arguments.
IOException
protected static void carryOutCommand(String mode,
String signature_mode,
String connector,
String signature_type,
String user_name,
String user_password,
int verify_which,
String input,
String output,
String pos_string)
throws PresentableException
This is simply the procedure that is executed after the commandline parameters have been parsed successfully.
mode - The operation mode (e.g. "sign", "verify").signature_mode - The signature mode (e.g. "binary", "textual").connector - The connector (e.g. "bku", "a1").signature_type - The signature type/profile. For signing only.user_name - The user name. For signing only.user_password - The user password. For signing only.verify_which - The number of the signature to be verified. For verifying only.input - The input file name.output - The output file name.
PresentableException
protected static String generateOutputFileNameFromInput(String input,
SignResult sign_result)
input - The input file name.sign_result - The sign result.
protected static void printUnrecognizedOption(String option)
throws PresentableException
option - The unrecognized option.
PresentableException - Forwarded exception.
protected static void printNoValue(String parameter)
throws PresentableException
parameter - The parameter, which is missing a value.
PresentableException - Forwarded exception.
protected static void printUnrecognizedValue(String parameter,
String value)
throws PresentableException
value - The unrecognized value.
PresentableException - Forwarded exception.
protected static void printUnrecognizedAdditionalCommandlineArgument(String argument)
throws PresentableException
argument - The unrecognized argument.
PresentableException - Forwarded exception.
protected static void printMissingParameter(String missing_term,
String parameter)
throws PresentableException
missing_term - A description of the missing parameter ("e.g. a mode").parameter - The missing parameter itself (e.g. "-mode").
PresentableException - Forwarded exception.
protected static void printMissing(String missing_term)
throws PresentableException
missing_term - A descriptive message of the missing thing.
PresentableException - Forwarded exception.protected static void printErrorCodeException(ErrorCodeException ece)
ece - The ErrorCodeException to be printed.
public static void printUsage(PrintStream writer)
throws PresentableException
writer - The writer to print the text to.
PresentableException - Forwarded exception.protected static boolean checkMode(String mode)
mode - The parameter's value.
protected static boolean checkSignatureMode(String signature_mode)
signature_mode - The parameter's value.
protected static boolean checkConnector(String connector)
throws ConnectorFactoryException
connector - The parameter's value.
ConnectorFactoryException - F.e.
protected static boolean checkSignatureType(String signature_type)
throws SignatureTypesException
signature_type - The parameter's value.
SignatureTypesExceptionprotected static PdfASID translateSignatureModeToPdfASID(String signature_mode)
signature_mode - The signator mode commandline argument.
protected static void formatVerifyResults(List results,
PrintStream writer)
throws SettingNotFoundException
results - The List of SignatureResponse verification results.writer - The output sink to write the formatted text to.
SettingNotFoundException - Forwarded exception.
public static void formatSignatureResponse(SignatureResponse result,
PrintStream writer)
throws SettingNotFoundException
result - The SignatureResponse to be printed.writer - The output sink to write the formatted text to.
SettingNotFoundException - Forwarded exception.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||