String alias = (String) parser.getOptionValue(CLIParserBuilder.ALIAS_ARG);
String keyPass = (String) parser.getOptionValue(CLIParserBuilder.KEY_PASS_ARG);
Boolean sign = (Boolean) parser.getOptionValue(CLIParserBuilder.SIGN_ARG);
if (sign != null && sign.booleanValue()) {
KeyStore keystore = getKeyStore(keystorePath, storeType, storePass);
Credential signingCredential = getSigningCredential(keystore, alias, keyPass);
sign(metadata, signingCredential);
} else {
if (keystorePath != null) {
KeyStore keystore = getKeyStore(keystorePath, storeType, storePass);
Credential verificationCredential = getVerificationCredential(keystore, alias);
verifySignature(metadata, verificationCredential);
}
}
String outputFile = (String) parser.getOptionValue(CLIParserBuilder.OUTPUT_FILE_ARG);