Class EnvelopedSignatureTest
- java.lang.Object
-
- org.opensaml.core.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.xml.XMLObjectBaseTestCase
-
- org.opensaml.xmlsec.signature.support.EnvelopedSignatureTest
-
public class EnvelopedSignatureTest extends XMLObjectBaseTestCase
Test to verifySignatureand its marshallers and unmarshallers.
-
-
Field Summary
Fields Modifier and Type Field Description private StringalgoURISignature algorithm URI.private CredentialbadCredentialInvalid credential for verification.private CredentialgoodCredentialCredential used to sign and verify.private org.slf4j.LoggerlogClass logger.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, parserPool, simpleXMLObjectQName, unmarshallerFactory
-
-
Constructor Summary
Constructors Constructor Description EnvelopedSignatureTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private SignableSimpleXMLObjectgetXMLObjectWithSignature()Creates a XMLObject that has a Signature child element.protected voidsetUp()voidtestSigningAndVerification()Tests creating an enveloped signature and then verifying it.voidtestUnmarshall()Tests unmarshalling an enveloped signature.-
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 Credential goodCredential
Credential used to sign and verify.
-
badCredential
private Credential badCredential
Invalid credential for verification.
-
sxoBuilder
private SignableSimpleXMLObjectBuilder sxoBuilder
Builder of mock XML objects.
-
sigBuilder
private XMLObjectBuilder<Signature> sigBuilder
Builder of Signature XML objects.
-
algoURI
private String algoURI
Signature algorithm URI.
-
-
Method Detail
-
setUp
@BeforeMethod protected void setUp() throws Exception
- Throws:
Exception
-
testSigningAndVerification
public void testSigningAndVerification() throws MarshallingException, javax.xml.bind.ValidationException, SignatureExceptionTests creating an enveloped signature and then verifying it.- Throws:
MarshallingException- thrown if the XMLObject tree can not be marshalledjavax.xml.bind.ValidationException- ...SignatureException- ...
-
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
private SignableSimpleXMLObject getXMLObjectWithSignature()
Creates a XMLObject that has a Signature child element.- Returns:
- a XMLObject that has a Signature child element
-
-