Class DetachedSignatureTest

java.lang.Object
org.opensaml.core.testing.OpenSAMLInitBaseTestCase
org.opensaml.core.testing.XMLObjectBaseTestCase
org.opensaml.xmlsec.signature.support.tests.DetachedSignatureTest

public class DetachedSignatureTest extends org.opensaml.core.testing.XMLObjectBaseTestCase
  • Field Details

    • log

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

      private BasicCredential goodCredential
      Key resolver containing proper verification key.
    • badCredential

      private BasicCredential badCredential
      Key resolver containing invalid verification key.
    • sxoBuilder

      private SignableSimpleXMLObjectBuilder sxoBuilder
      Builder of mock XML objects.
    • sigBuilder

      private XMLObjectBuilder<Signature> sigBuilder
      Builder of Signature XML objects.
    • parserPool

      private BasicParserPool parserPool
      Parser pool used to parse example config files.
    • algoURI

      private String algoURI
      Signature algorithm URI.
  • Constructor Details

    • DetachedSignatureTest

      public DetachedSignatureTest()
  • Method Details

    • setUp

      @BeforeMethod protected void setUp() throws Exception
      Throws:
      Exception
    • testInternalSignatureAndVerification

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

      public void testExternalSignatureAndVerification() throws MarshallingException, 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:
      MarshallingException - thrown if the XMLObject tree can not be marshalled
      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