Class EnvelopedSignatureTest


  • public class EnvelopedSignatureTest
    extends org.opensaml.core.xml.XMLObjectBaseTestCase
    Test to verify Signature and its marshallers and unmarshallers.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private String algoURI
      Signature algorithm URI.
      private org.opensaml.security.credential.Credential badCredential
      Invalid credential for verification.
      private org.opensaml.security.credential.Credential goodCredential
      Credential used to sign and verify.
      private org.slf4j.Logger log
      Class logger.
      private org.opensaml.core.xml.XMLObjectBuilder<org.opensaml.xmlsec.signature.Signature> sigBuilder
      Builder of Signature XML objects.
      private SignableSimpleXMLObjectBuilder sxoBuilder
      Builder of mock XML objects.
      • Fields inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase

        builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory
    • Field Detail

      • log

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

        private org.opensaml.security.credential.Credential goodCredential
        Credential used to sign and verify.
      • badCredential

        private org.opensaml.security.credential.Credential badCredential
        Invalid credential for verification.
      • sigBuilder

        private org.opensaml.core.xml.XMLObjectBuilder<org.opensaml.xmlsec.signature.Signature> sigBuilder
        Builder of Signature XML objects.
      • algoURI

        private String algoURI
        Signature algorithm URI.
    • Constructor Detail

      • EnvelopedSignatureTest

        public EnvelopedSignatureTest()
    • Method Detail

      • testSigningAndVerification

        public void testSigningAndVerification()
                                        throws org.opensaml.core.xml.io.MarshallingException,
                                               javax.xml.bind.ValidationException,
                                               org.opensaml.xmlsec.signature.support.SignatureException
        Tests creating an enveloped signature and then verifying it.
        Throws:
        org.opensaml.core.xml.io.MarshallingException - thrown if the XMLObject tree can not be marshalled
        javax.xml.bind.ValidationException - ...
        org.opensaml.xmlsec.signature.support.SignatureException - ...
      • testUnmarshall

        public void testUnmarshall()
                            throws net.shibboleth.utilities.java.support.xml.XMLParserException,
                                   org.opensaml.core.xml.io.UnmarshallingException,
                                   GeneralSecurityException
        Tests unmarshalling an enveloped signature.
        Throws:
        net.shibboleth.utilities.java.support.xml.XMLParserException - thrown if the XML can not be parsed
        org.opensaml.core.xml.io.UnmarshallingException - thrown if the DOM can not be unmarshalled
        GeneralSecurityException - ...
      • getXMLObjectWithSignature

        private SignableSimpleXMLObject getXMLObjectWithSignature()
        Creates a XMLObject that has a Signature child element.
        Returns:
        a XMLObject that has a Signature child element