Class DetachedSignatureTest


  • public class DetachedSignatureTest
    extends org.opensaml.core.xml.XMLObjectBaseTestCase
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private String algoURI
      Signature algorithm URI.
      private org.opensaml.security.credential.BasicCredential badCredential
      Key resolver containing invalid verification key.
      private org.opensaml.security.credential.BasicCredential goodCredential
      Key resolver containing proper verification key.
      private org.slf4j.Logger log
      Class logger.
      private net.shibboleth.utilities.java.support.xml.BasicParserPool parserPool
      Parser pool used to parse example config files.
      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, simpleXMLObjectQName, unmarshallerFactory
    • Field Detail

      • log

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

        private org.opensaml.security.credential.BasicCredential goodCredential
        Key resolver containing proper verification key.
      • badCredential

        private org.opensaml.security.credential.BasicCredential badCredential
        Key resolver containing invalid verification key.
      • sigBuilder

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

        private net.shibboleth.utilities.java.support.xml.BasicParserPool parserPool
        Parser pool used to parse example config files.
      • algoURI

        private String algoURI
        Signature algorithm URI.
    • Constructor Detail

      • DetachedSignatureTest

        public DetachedSignatureTest()
    • Method Detail

      • testInternalSignatureAndVerification

        public void testInternalSignatureAndVerification()
                                                  throws org.opensaml.core.xml.io.MarshallingException,
                                                         org.opensaml.core.xml.io.UnmarshallingException,
                                                         org.opensaml.xmlsec.signature.support.SignatureException
        Tests creating a detached signature within the same document as the element signed and then verifying it.
        Throws:
        org.opensaml.core.xml.io.MarshallingException - thrown if the XMLObject tree can not be marshalled
        org.opensaml.core.xml.io.UnmarshallingException - thrown if the signature can not be unmarshalled
        org.opensaml.xmlsec.signature.support.SignatureException - ...
      • testExternalSignatureAndVerification

        public void testExternalSignatureAndVerification()
                                                  throws org.opensaml.core.xml.io.MarshallingException,
                                                         org.opensaml.xmlsec.signature.support.SignatureException
        Tests creating a detached signature within a different document as the element signed and then verifying it. The external references used are the InCommon and InQueue metadata files.
        Throws:
        org.opensaml.core.xml.io.MarshallingException - thrown if the XMLObject tree can not be marshalled
        org.opensaml.xmlsec.signature.support.SignatureException - ...
      • getXMLObjectWithSignature

        private SignableSimpleXMLObject getXMLObjectWithSignature()
        Creates a XMLObject that has another XMLObject and a Signature as children. The Signature is is a detached signature of its sibling.
        Returns:
        the XMLObject