Class HMACSignatureTest

    • Field Detail

      • log

        private final org.slf4j.Logger log
        Class logger.
      • goodCredential

        private Credential goodCredential
        Credential used to sign and verify.
      • badCredential

        private Credential badCredential
        Invalid credential for verification.
      • hmacOutputLength

        private Integer hmacOutputLength
        Value of HMACOutputLength element child of SignatureMethod.
      • expectedKeyName

        private String expectedKeyName
        Expected key name value in KeyInfo.
      • algoURI

        private String algoURI
        Signature algorithm URI.
    • Constructor Detail

      • HMACSignatureTest

        public HMACSignatureTest()
    • Method Detail

      • testSigningAndVerificationNoOutputLength

        public void testSigningAndVerificationNoOutputLength()
                                                      throws MarshallingException,
                                                             javax.xml.bind.ValidationException,
                                                             SignatureException
        Tests creating an enveloped signature and then verifying it.
        Throws:
        MarshallingException - thrown if the XMLObject tree can not be marshalled
        javax.xml.bind.ValidationException - thrown if signature validator fails to validate the signature
        SignatureException - ...
      • testMarshallNoOutputLength

        public void testMarshallNoOutputLength()
                                        throws MarshallingException
        Tests marshalling with SignatureMethod/HMACOutputLength not present.
        Throws:
        MarshallingException - thrown in signed object can't be marshalled
      • testMarshallWithOutputLength

        public void testMarshallWithOutputLength()
                                          throws MarshallingException
        Tests marshalling with SignatureMethod/HMACOutputLength present.
        Throws:
        MarshallingException - thrown in signed object can't be marshalled
      • getXMLObjectWithSignature

        private SignableSimpleXMLObject getXMLObjectWithSignature​(boolean useHMACOutputLength)
        Creates a XMLObject that has a Signature child element.
        Parameters:
        useHMACOutputLength - if true, set value for HMACOutputLength
        Returns:
        a XMLObject that has a Signature child element