edu.internet2.middleware.security
Class XmlSecToolCommandLineArguments

java.lang.Object
  extended by edu.internet2.middleware.security.XmlSecToolCommandLineArguments

public class XmlSecToolCommandLineArguments
extends Object

Command line arguments for the XmlSecTool command line tool.


Nested Class Summary
 class XmlSecToolCommandLineArguments.Blacklist
          A blacklist of digest and signature algorithms we should not accept during signature verification.
static class XmlSecToolCommandLineArguments.DigestChoice
          The digest method to use in the various signature algorithms.
 
Field Summary
private  jargs.gnu.CmdLineParser.Option BASE64_IN_ARG
           
private  jargs.gnu.CmdLineParser.Option BASE64_OUT_ARG
           
private  boolean base64DecodeInput
           
private  boolean base64EncodeOutput
           
private  XmlSecToolCommandLineArguments.Blacklist blacklist
          Local blacklist of signature and digest algorithms.
private  jargs.gnu.CmdLineParser.Option blacklistDigestArg
          Command line option indicating digests to be blacklisted.
private  Collection<XmlSecToolCommandLineArguments.DigestChoice> blacklistDigests
          Collection of digest choices to be blacklisted.
private  String cert
           
private  jargs.gnu.CmdLineParser.Option CERT_ARG
           
private  boolean clearBlacklist
          Option requesting that the signature verification blacklists be cleared.
private  jargs.gnu.CmdLineParser.Option clearBlacklistArg
          Command line option requesting that the signature verification blacklists be cleared.
private  jargs.gnu.CmdLineParser cliParser
           
private  jargs.gnu.CmdLineParser.Option DEFLATE_OUT_ARG
           
private  boolean deflateOutput
           
private  XmlSecToolCommandLineArguments.DigestChoice digest
          Digest algorithm choice for all algorithms.
private  String digestAlgorithm
          Digest algorithm URI directly specified on the command line.
private  jargs.gnu.CmdLineParser.Option digestAlgorithmArg
          Command line option specifying the digest algorithm URI.
private  jargs.gnu.CmdLineParser.Option digestArg
          Command line option specifying the digest algorithm to be used in the various signature algorithms in a convenient short form.
private  String digestName
          Selected digest algorithm choice name for all algorithms.
private  jargs.gnu.CmdLineParser.Option GUNZIP_IN_ARG
           
private  boolean gunzipInput
           
private  jargs.gnu.CmdLineParser.Option GZIP_OUT_ARG
           
private  boolean gzipOutput
           
private  boolean help
           
private  jargs.gnu.CmdLineParser.Option HELP_ARG
           
private  jargs.gnu.CmdLineParser.Option HTTP_PROXY_ARG
           
private  jargs.gnu.CmdLineParser.Option HTTP_PROXY_PASSWORD_ARG
           
private  jargs.gnu.CmdLineParser.Option HTTP_PROXY_PORT_ARG
           
private  jargs.gnu.CmdLineParser.Option HTTP_PROXY_USERNAME_ARG
           
private  String httpProxy
           
private  String httpProxyPassword
           
private  int httpProxyPort
           
private  String httpProxyUsername
           
private  jargs.gnu.CmdLineParser.Option IN_FILE_ARG
           
private  jargs.gnu.CmdLineParser.Option IN_URL_ARG
           
private  List<String> inclusiveNamespacePrefixs
           
private  String inFile
           
private  jargs.gnu.CmdLineParser.Option INFLATE_IN_ARG
           
private  boolean inflateInput
           
private  String inUrl
           
private  String key
           
private  jargs.gnu.CmdLineParser.Option KEY_ARG
           
private  jargs.gnu.CmdLineParser.Option KEY_PASSWORD_ARG
           
private  String keyPassword
           
private  String keystore
           
private  jargs.gnu.CmdLineParser.Option KEYSTORE_ARG
           
private  jargs.gnu.CmdLineParser.Option KEYSTORE_PASSWORD_ARG
           
private  jargs.gnu.CmdLineParser.Option KEYSTORE_PROVIDER_ARG
           
private  jargs.gnu.CmdLineParser.Option KEYSTORE_TYPE_ARG
           
private  String keystorePassword
           
private  String keystoreProvider
           
private  String keystoreType
           
private  jargs.gnu.CmdLineParser.Option KI_CRL_ARG
           
private  jargs.gnu.CmdLineParser.Option KI_KEY_NAME_ARG
           
private  List<String> kiCrls
           
private  List<String> kiKeyNames
           
private  boolean listBlacklist
          Option requesting that the signature verification blacklists be listed.
private  jargs.gnu.CmdLineParser.Option listBlacklistArg
          Command line option requesting that the signature verification blacklists be listed.
private  jargs.gnu.CmdLineParser.Option LOG_CONFIG_ARG
           
private  String logConfig
           
private  jargs.gnu.CmdLineParser.Option OUT_FILE_ARG
           
private  String outFile
           
private  jargs.gnu.CmdLineParser.Option PKCS11_CONFIG_ARG
           
private  String pkcs11Config
           
private  boolean quiet
           
private  jargs.gnu.CmdLineParser.Option QUIET_ARG
           
private  String refIdAttributeName
           
private  boolean rngSchema
           
private  jargs.gnu.CmdLineParser.Option SCHEMA_DIR_ARG
           
private  jargs.gnu.CmdLineParser.Option SCHEMA_RNG_LANG_ARG
           
private  jargs.gnu.CmdLineParser.Option SCHEMA_XSD_LANG_ARG
           
private  String schemaDirectory
           
private  boolean schemaValidate
           
private  jargs.gnu.CmdLineParser.Option SIG_INC_PREFIX_ARG
           
private  jargs.gnu.CmdLineParser.Option SIG_POS_ARG
           
private  jargs.gnu.CmdLineParser.Option SIG_REF_ID_ATT_ARG
           
private  jargs.gnu.CmdLineParser.Option SIG_REQUIRED_ARG
           
private  boolean sign
           
private  jargs.gnu.CmdLineParser.Option SIGN_ARG
           
private  String signatureAlgorithm
          Signature algorithm URI directly specified on the command line.
private  jargs.gnu.CmdLineParser.Option signatureAlgorithmArg
          Command line option specifying the signature algorithm URI.
private  String signaturePosition
           
private  boolean signatureRequired
           
private  boolean signatureVerify
           
private  jargs.gnu.CmdLineParser.Option V_SCHEMA_ARG
           
private  jargs.gnu.CmdLineParser.Option V_SIG_ARG
           
private  boolean verbose
           
private  jargs.gnu.CmdLineParser.Option VERBOSE_ARG
           
private  boolean xsdSchema
           
 
Constructor Summary
XmlSecToolCommandLineArguments(String[] args)
           
 
Method Summary
 boolean doClearBlacklist()
          Indicates whether the option to clear the blacklist has been selected.
 boolean doHelp()
           
 boolean doListBlacklist()
          Indicates whether the option to list the blacklist has been selected.
 boolean doQuietOutput()
           
 boolean doSchemaValidation()
           
 boolean doSign()
           
 boolean doSignatureVerify()
           
 boolean doVerboseOutput()
           
private  void errorAndExit(String error)
          Prints the error message to STDERR and then exits.
 XmlSecToolCommandLineArguments.Blacklist getBlacklist()
          Returns the signature verification algorithm blacklist.
 Collection<XmlSecToolCommandLineArguments.DigestChoice> getBlacklistDigests()
          Returns the digests designated to be blacklisted on the command line.
 String getCertificate()
           
 XmlSecToolCommandLineArguments.DigestChoice getDigest()
          Returns the choice of digest algorithm.
 String getDigestAlgorithm()
          Returns the digest algorithm URI if specified on the command line.
 String getHttpProxy()
           
 String getHttpProxyPassword()
           
 int getHttpProxyPort()
           
 String getHttpProxyUsername()
           
 List<String> getInclusiveNamespacePrefixs()
           
 String getInputFile()
           
 String getInputUrl()
           
 String getKey()
           
 List<String> getKeyInfoCrls()
           
 List<String> getKeyInfoKeyNames()
           
 String getKeyPassword()
           
 String getKeystore()
           
 String getKeystorePassword()
           
 String getKeystoreProvider()
           
 String getKeystoreType()
           
 String getLoggingConfiguration()
           
 String getOutputFile()
           
 String getPkcs11Config()
           
 String getReferenceIdAttributeName()
           
 String getSchemaDirectory()
           
 String getSignatureAlgorithm()
          Returns the signature algorithm URI if specified on the command line.
 String getSignaturePosition()
           
 boolean isBase64DecodeInput()
           
 boolean isBase64EncodedOutput()
           
 boolean isDeflateOutput()
           
 boolean isGunzipInput()
           
 boolean isGzipOutput()
           
 boolean isInflateInput()
           
 boolean isRngSchema()
           
 boolean isSignatureRequired()
           
 boolean isXsdSchema()
           
 void parseCommandLineArguments(String[] args)
           
 void printHelp(PrintStream out)
          Print command line help instructions.
private  void validateCommandLineArguments()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sign

private boolean sign

SIGN_ARG

private jargs.gnu.CmdLineParser.Option SIGN_ARG

schemaValidate

private boolean schemaValidate

V_SCHEMA_ARG

private jargs.gnu.CmdLineParser.Option V_SCHEMA_ARG

signatureVerify

private boolean signatureVerify

V_SIG_ARG

private jargs.gnu.CmdLineParser.Option V_SIG_ARG

inFile

private String inFile

IN_FILE_ARG

private jargs.gnu.CmdLineParser.Option IN_FILE_ARG

inUrl

private String inUrl

IN_URL_ARG

private jargs.gnu.CmdLineParser.Option IN_URL_ARG

base64DecodeInput

private boolean base64DecodeInput

BASE64_IN_ARG

private jargs.gnu.CmdLineParser.Option BASE64_IN_ARG

inflateInput

private boolean inflateInput

INFLATE_IN_ARG

private jargs.gnu.CmdLineParser.Option INFLATE_IN_ARG

gunzipInput

private boolean gunzipInput

GUNZIP_IN_ARG

private jargs.gnu.CmdLineParser.Option GUNZIP_IN_ARG

httpProxy

private String httpProxy

HTTP_PROXY_ARG

private jargs.gnu.CmdLineParser.Option HTTP_PROXY_ARG

httpProxyPort

private int httpProxyPort

HTTP_PROXY_PORT_ARG

private jargs.gnu.CmdLineParser.Option HTTP_PROXY_PORT_ARG

httpProxyUsername

private String httpProxyUsername

HTTP_PROXY_USERNAME_ARG

private jargs.gnu.CmdLineParser.Option HTTP_PROXY_USERNAME_ARG

httpProxyPassword

private String httpProxyPassword

HTTP_PROXY_PASSWORD_ARG

private jargs.gnu.CmdLineParser.Option HTTP_PROXY_PASSWORD_ARG

schemaDirectory

private String schemaDirectory

SCHEMA_DIR_ARG

private jargs.gnu.CmdLineParser.Option SCHEMA_DIR_ARG

xsdSchema

private boolean xsdSchema

SCHEMA_XSD_LANG_ARG

private jargs.gnu.CmdLineParser.Option SCHEMA_XSD_LANG_ARG

rngSchema

private boolean rngSchema

SCHEMA_RNG_LANG_ARG

private jargs.gnu.CmdLineParser.Option SCHEMA_RNG_LANG_ARG

signatureRequired

private boolean signatureRequired

SIG_REQUIRED_ARG

private jargs.gnu.CmdLineParser.Option SIG_REQUIRED_ARG

refIdAttributeName

private String refIdAttributeName

SIG_REF_ID_ATT_ARG

private jargs.gnu.CmdLineParser.Option SIG_REF_ID_ATT_ARG

signaturePosition

private String signaturePosition

SIG_POS_ARG

private jargs.gnu.CmdLineParser.Option SIG_POS_ARG

inclusiveNamespacePrefixs

private List<String> inclusiveNamespacePrefixs

SIG_INC_PREFIX_ARG

private jargs.gnu.CmdLineParser.Option SIG_INC_PREFIX_ARG

digest

private XmlSecToolCommandLineArguments.DigestChoice digest
Digest algorithm choice for all algorithms.


digestName

private String digestName
Selected digest algorithm choice name for all algorithms.


digestArg

private jargs.gnu.CmdLineParser.Option digestArg
Command line option specifying the digest algorithm to be used in the various signature algorithms in a convenient short form.


digestAlgorithm

private String digestAlgorithm
Digest algorithm URI directly specified on the command line.


digestAlgorithmArg

private jargs.gnu.CmdLineParser.Option digestAlgorithmArg
Command line option specifying the digest algorithm URI.


signatureAlgorithm

private String signatureAlgorithm
Signature algorithm URI directly specified on the command line.


signatureAlgorithmArg

private jargs.gnu.CmdLineParser.Option signatureAlgorithmArg
Command line option specifying the signature algorithm URI.


kiKeyNames

private List<String> kiKeyNames

KI_KEY_NAME_ARG

private jargs.gnu.CmdLineParser.Option KI_KEY_NAME_ARG

kiCrls

private List<String> kiCrls

KI_CRL_ARG

private jargs.gnu.CmdLineParser.Option KI_CRL_ARG

outFile

private String outFile

OUT_FILE_ARG

private jargs.gnu.CmdLineParser.Option OUT_FILE_ARG

base64EncodeOutput

private boolean base64EncodeOutput

BASE64_OUT_ARG

private jargs.gnu.CmdLineParser.Option BASE64_OUT_ARG

deflateOutput

private boolean deflateOutput

DEFLATE_OUT_ARG

private jargs.gnu.CmdLineParser.Option DEFLATE_OUT_ARG

gzipOutput

private boolean gzipOutput

GZIP_OUT_ARG

private jargs.gnu.CmdLineParser.Option GZIP_OUT_ARG

cert

private String cert

CERT_ARG

private jargs.gnu.CmdLineParser.Option CERT_ARG

key

private String key

KEY_ARG

private jargs.gnu.CmdLineParser.Option KEY_ARG

keyPassword

private String keyPassword

KEY_PASSWORD_ARG

private jargs.gnu.CmdLineParser.Option KEY_PASSWORD_ARG

keystore

private String keystore

KEYSTORE_ARG

private jargs.gnu.CmdLineParser.Option KEYSTORE_ARG

keystorePassword

private String keystorePassword

KEYSTORE_PASSWORD_ARG

private jargs.gnu.CmdLineParser.Option KEYSTORE_PASSWORD_ARG

keystoreType

private String keystoreType

KEYSTORE_TYPE_ARG

private jargs.gnu.CmdLineParser.Option KEYSTORE_TYPE_ARG

keystoreProvider

private String keystoreProvider

KEYSTORE_PROVIDER_ARG

private jargs.gnu.CmdLineParser.Option KEYSTORE_PROVIDER_ARG

pkcs11Config

private String pkcs11Config

PKCS11_CONFIG_ARG

private jargs.gnu.CmdLineParser.Option PKCS11_CONFIG_ARG

blacklist

private final XmlSecToolCommandLineArguments.Blacklist blacklist
Local blacklist of signature and digest algorithms.


clearBlacklist

private boolean clearBlacklist
Option requesting that the signature verification blacklists be cleared.


clearBlacklistArg

private jargs.gnu.CmdLineParser.Option clearBlacklistArg
Command line option requesting that the signature verification blacklists be cleared.


listBlacklist

private boolean listBlacklist
Option requesting that the signature verification blacklists be listed.


listBlacklistArg

private jargs.gnu.CmdLineParser.Option listBlacklistArg
Command line option requesting that the signature verification blacklists be listed.


blacklistDigests

private final Collection<XmlSecToolCommandLineArguments.DigestChoice> blacklistDigests
Collection of digest choices to be blacklisted.


blacklistDigestArg

private jargs.gnu.CmdLineParser.Option blacklistDigestArg
Command line option indicating digests to be blacklisted.


verbose

private boolean verbose

VERBOSE_ARG

private jargs.gnu.CmdLineParser.Option VERBOSE_ARG

quiet

private boolean quiet

QUIET_ARG

private jargs.gnu.CmdLineParser.Option QUIET_ARG

logConfig

private String logConfig

LOG_CONFIG_ARG

private jargs.gnu.CmdLineParser.Option LOG_CONFIG_ARG

help

private boolean help

HELP_ARG

private jargs.gnu.CmdLineParser.Option HELP_ARG

cliParser

private jargs.gnu.CmdLineParser cliParser
Constructor Detail

XmlSecToolCommandLineArguments

public XmlSecToolCommandLineArguments(String[] args)
Method Detail

parseCommandLineArguments

public void parseCommandLineArguments(String[] args)

getHttpProxy

public String getHttpProxy()

getHttpProxyPort

public int getHttpProxyPort()

getHttpProxyUsername

public String getHttpProxyUsername()

getHttpProxyPassword

public String getHttpProxyPassword()

doSign

public boolean doSign()

doSchemaValidation

public boolean doSchemaValidation()

doSignatureVerify

public boolean doSignatureVerify()

isSignatureRequired

public boolean isSignatureRequired()

getReferenceIdAttributeName

public String getReferenceIdAttributeName()

getSignaturePosition

public String getSignaturePosition()

getInclusiveNamespacePrefixs

public List<String> getInclusiveNamespacePrefixs()

getDigest

public XmlSecToolCommandLineArguments.DigestChoice getDigest()
Returns the choice of digest algorithm.

Returns:
selected digest algorithm

getDigestAlgorithm

public String getDigestAlgorithm()
Returns the digest algorithm URI if specified on the command line.

Returns:
a digest algorithm identifier, or null.

getSignatureAlgorithm

public String getSignatureAlgorithm()
Returns the signature algorithm URI if specified on the command line.

Returns:
a signature algorithm identifier, or null.

getKeyInfoKeyNames

public List<String> getKeyInfoKeyNames()

getKeyInfoCrls

public List<String> getKeyInfoCrls()

getInputFile

public String getInputFile()

getInputUrl

public String getInputUrl()

isBase64DecodeInput

public boolean isBase64DecodeInput()

isInflateInput

public boolean isInflateInput()

isGunzipInput

public boolean isGunzipInput()

getSchemaDirectory

public String getSchemaDirectory()

isXsdSchema

public boolean isXsdSchema()

isRngSchema

public boolean isRngSchema()

getOutputFile

public String getOutputFile()

isBase64EncodedOutput

public boolean isBase64EncodedOutput()

isDeflateOutput

public boolean isDeflateOutput()

isGzipOutput

public boolean isGzipOutput()

getCertificate

public String getCertificate()

getKey

public String getKey()

getKeyPassword

public String getKeyPassword()

getKeystore

public String getKeystore()

getKeystorePassword

public String getKeystorePassword()

getKeystoreType

public String getKeystoreType()

getKeystoreProvider

public String getKeystoreProvider()

getPkcs11Config

public String getPkcs11Config()

getBlacklist

public XmlSecToolCommandLineArguments.Blacklist getBlacklist()
Returns the signature verification algorithm blacklist.

Returns:
algorithm blacklist

doClearBlacklist

public boolean doClearBlacklist()
Indicates whether the option to clear the blacklist has been selected.

Returns:
true if option selected

doListBlacklist

public boolean doListBlacklist()
Indicates whether the option to list the blacklist has been selected.

Returns:
true if option selected

getBlacklistDigests

public Collection<XmlSecToolCommandLineArguments.DigestChoice> getBlacklistDigests()
Returns the digests designated to be blacklisted on the command line.

Returns:
collection of XmlSecToolCommandLineArguments.DigestChoices to be blacklisted

doVerboseOutput

public boolean doVerboseOutput()

doQuietOutput

public boolean doQuietOutput()

getLoggingConfiguration

public String getLoggingConfiguration()

doHelp

public boolean doHelp()

validateCommandLineArguments

private void validateCommandLineArguments()

printHelp

public void printHelp(PrintStream out)
Print command line help instructions.

Parameters:
out - location where to print the output

errorAndExit

private void errorAndExit(String error)
Prints the error message to STDERR and then exits.

Parameters:
error - the error message


Copyright © 1999-2013. All Rights Reserved.