Class CryptoCoverageChecker

    • Constructor Detail

      • CryptoCoverageChecker

        public CryptoCoverageChecker()
        Creates a new instance. See #setPrefixes() and #setXpaths() for providing configuration options.
      • CryptoCoverageChecker

        public CryptoCoverageChecker​(Map<String,​String> prefixes,
                                     List<CryptoCoverageChecker.XPathExpression> xPaths)
        Creates a new instance that checks for signature coverage over matches to the provided XPath expressions making defensive copies of provided arguments.
        Parameters:
        prefixes - mapping of namespace prefixes to namespace URIs
        xPaths - a list of XPath expressions
    • Method Detail

      • handleMessage

        public void handleMessage​(SoapMessage message)
                           throws Fault
        Checks that the WSS4J results refer to the required signed/encrypted elements as defined by the XPath expressions in xPaths.
        Parameters:
        message - the SOAP message containing the signature
        Throws:
        SoapFault - if there is an error evaluating an XPath or an element is not covered by the required cryptographic operation
        Fault
      • setXPaths

        public final void setXPaths​(List<CryptoCoverageChecker.XPathExpression> xpaths)
        Sets the XPath expressions to check for, clearing all previously set expressions.
        Parameters:
        xpaths - the XPath expressions to check for
      • addXPaths

        public final void addXPaths​(List<CryptoCoverageChecker.XPathExpression> xpaths)
        Adds the XPath expressions to check for, adding to any previously set expressions.
        Parameters:
        xpaths - the XPath expressions to check for
      • setPrefixes

        public final void setPrefixes​(Map<String,​String> prefixes)
        Sets the mapping of namespace prefixes to namespace URIs, clearing all previously set mappings.
        Parameters:
        prefixes - the mapping of namespace prefixes to namespace URIs
      • addPrefixes

        public final void addPrefixes​(Map<String,​String> prefixes)
        Adds the mapping of namespace prefixes to namespace URIs, adding to any previously set mappings.
        Parameters:
        prefixes - the mapping of namespace prefixes to namespace URIs
      • isCheckFaults

        public boolean isCheckFaults()
      • setCheckFaults

        public void setCheckFaults​(boolean checkFaults)