Class EnvelopedSignatureTest
java.lang.Object
org.opensaml.core.testing.OpenSAMLInitBaseTestCase
org.opensaml.core.testing.XMLObjectBaseTestCase
org.opensaml.xmlsec.signature.support.tests.EnvelopedSignatureTest
public class EnvelopedSignatureTest
extends org.opensaml.core.testing.XMLObjectBaseTestCase
Test to verify
Signature and its marshallers and unmarshallers.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringSignature algorithm URI.private CredentialInvalid credential for verification.private CredentialCredential used to sign and verify.private final org.slf4j.LoggerClass logger.private XMLObjectBuilder<Signature>Builder of Signature XML objects.private SignableSimpleXMLObjectBuilderBuilder of mock XML objects.Fields inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase
builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate SignableSimpleXMLObjectCreates a XMLObject that has a Signature child element.protected voidsetUp()voidTests creating an enveloped signature and then verifying it.voidTests unmarshalling an enveloped signature.Methods inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase
assertXMLEquals, assertXMLEquals, buildXMLObject, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElement, unmarshallElementMethods inherited from class org.opensaml.core.testing.OpenSAMLInitBaseTestCase
initOpenSAML
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
goodCredential
Credential used to sign and verify. -
badCredential
Invalid credential for verification. -
sxoBuilder
Builder of mock XML objects. -
sigBuilder
Builder of Signature XML objects. -
algoURI
Signature algorithm URI.
-
-
Constructor Details
-
EnvelopedSignatureTest
public EnvelopedSignatureTest()
-
-
Method Details
-
setUp
- Throws:
Exception
-
testSigningAndVerification
Tests creating an enveloped signature and then verifying it.- Throws:
MarshallingException- thrown if the XMLObject tree can not be marshalledSignatureException- ...
-
testUnmarshall
public void testUnmarshall() throws XMLParserException, UnmarshallingException, GeneralSecurityExceptionTests unmarshalling an enveloped signature.- Throws:
XMLParserException- thrown if the XML can not be parsedUnmarshallingException- thrown if the DOM can not be unmarshalledGeneralSecurityException- ...
-
getXMLObjectWithSignature
Creates a XMLObject that has a Signature child element.- Returns:
- a XMLObject that has a Signature child element
-