Class DetachedSignatureTest
- java.lang.Object
-
- org.opensaml.core.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.xml.XMLObjectBaseTestCase
-
- org.opensaml.xmlsec.signature.support.DetachedSignatureTest
-
public class DetachedSignatureTest extends XMLObjectBaseTestCase
-
-
Field Summary
Fields Modifier and Type Field Description private StringalgoURISignature algorithm URI.private BasicCredentialbadCredentialKey resolver containing invalid verification key.private BasicCredentialgoodCredentialKey resolver containing proper verification key.private org.slf4j.LoggerlogClass logger.private BasicParserPoolparserPoolParser pool used to parse example config files.private XMLObjectBuilder<Signature>sigBuilderBuilder of Signature XML objects.private SignableSimpleXMLObjectBuildersxoBuilderBuilder of mock XML objects.-
Fields inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase
builderFactory, marshallerFactory, simpleXMLObjectQName, unmarshallerFactory
-
-
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
-
Methods inherited from class org.opensaml.core.OpenSAMLInitBaseTestCase
initOpenSAML
-
-
-
-
Field Detail
-
log
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.
-
-
Method Detail
-
setUp
@BeforeMethod protected void setUp() throws Exception
- Throws:
Exception
-
testInternalSignatureAndVerification
public void testInternalSignatureAndVerification() throws MarshallingException, UnmarshallingException, SignatureExceptionTests 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 marshalledUnmarshallingException- thrown if the signature can not be unmarshalledSignatureException- ...
-
testExternalSignatureAndVerification
public void testExternalSignatureAndVerification() throws MarshallingException, 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:
MarshallingException- thrown if the XMLObject tree can not be marshalledSignatureException- ...
-
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
-
-