Class CommandLineArguments


  • public class CommandLineArguments
    extends Object
    Command line arguments for the XMLSecTool command line tool.
    • Constructor Detail

      • CommandLineArguments

        public CommandLineArguments()
    • Method Detail

      • parseCommandLineArguments

        public void parseCommandLineArguments​(String[] args)
        Parse the command-line arguments.

        As well as basic parsing, this also:

        • validates the options used: results in fatal errors if they are invalid
        • applies some defaults
        • processes the options related to the disallowed algorithm list
        Parameters:
        args - array of command-line arguments to parse
      • checkForDeprecations

        public void checkForDeprecations()
        Checks for any deprecations in the command-line options.

        The logging system must have been set up before this is called.

      • processDisallowedAlgorithmOptions

        private void processDisallowedAlgorithmOptions()
        Handle options related to setting up the disallowed algorithm collection. These are --allowAllDigests, --disallowDigest and --allowDigest. The legacy forms (--clearBlacklist, --blacklistDigest and --whitelistDigest are also handled here.
      • 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()
      • getReferenceIdAttributeName

        public String getReferenceIdAttributeName()
      • getSignaturePosition

        public String getSignaturePosition()
      • getDigest

        public 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()
      • getKeyFile

        public String getKeyFile()
      • getKeyAlias

        public String getKeyAlias()
      • getKeyPassword

        public String getKeyPassword()
      • getKeystore

        public String getKeystore()
      • getKeystorePassword

        public String getKeystorePassword()
      • getKeystoreType

        public String getKeystoreType()
      • getKeystoreProvider

        public String getKeystoreProvider()
      • getPkcs11Config

        public String getPkcs11Config()
      • doListAlgorithms

        public boolean doListAlgorithms()
        Indicates whether the option to list the disallowed algorithms has been selected.
        Returns:
        true if option selected
      • 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