Class DetachedSignatureTest
- java.lang.Object
-
- org.opensaml.core.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.xml.XMLObjectBaseTestCase
-
- org.opensaml.xmlsec.signature.support.DetachedSignatureTest
-
public class DetachedSignatureTest extends org.opensaml.core.xml.XMLObjectBaseTestCase
-
-
Field Summary
Fields Modifier and Type Field Description private StringalgoURISignature algorithm URI.private org.opensaml.security.credential.BasicCredentialbadCredentialKey resolver containing invalid verification key.private org.opensaml.security.credential.BasicCredentialgoodCredentialKey resolver containing proper verification key.private org.slf4j.LoggerlogClass logger.private net.shibboleth.utilities.java.support.xml.BasicParserPoolparserPoolParser pool used to parse example config files.private org.opensaml.core.xml.XMLObjectBuilder<org.opensaml.xmlsec.signature.Signature>sigBuilderBuilder of Signature XML objects.private SignableSimpleXMLObjectBuildersxoBuilderBuilder of mock XML objects.
-
Constructor Summary
Constructors Constructor Description DetachedSignatureTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private SignableSimpleXMLObjectgetXMLObjectWithSignature()Creates a XMLObject that has another XMLObject and a Signature as children.protected voidsetUp()voidtestExternalSignatureAndVerification()Tests creating a detached signature within a different document as the element signed and then verifying it.voidtestInternalSignatureAndVerification()Tests creating a detached signature within the same document as the element signed and then verifying it.-
Methods inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase
assertXMLEquals, assertXMLEquals, buildXMLObject, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElement, unmarshallElement
-
-
-
-
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.
-
sxoBuilder
private SignableSimpleXMLObjectBuilder sxoBuilder
Builder of mock XML objects.
-
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.
-
-
Method Detail
-
setUp
@BeforeMethod protected void setUp() throws Exception
- Throws:
Exception
-
testInternalSignatureAndVerification
public void testInternalSignatureAndVerification() throws org.opensaml.core.xml.io.MarshallingException, org.opensaml.core.xml.io.UnmarshallingException, org.opensaml.xmlsec.signature.support.SignatureExceptionTests 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 marshalledorg.opensaml.core.xml.io.UnmarshallingException- thrown if the signature can not be unmarshalledorg.opensaml.xmlsec.signature.support.SignatureException- ...
-
testExternalSignatureAndVerification
public void testExternalSignatureAndVerification() throws org.opensaml.core.xml.io.MarshallingException, org.opensaml.xmlsec.signature.support.SignatureExceptionTests 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 marshalledorg.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
-
-