Class EnvelopedSignatureTest
- java.lang.Object
-
- org.opensaml.core.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.xml.XMLObjectBaseTestCase
-
- org.opensaml.xmlsec.signature.support.EnvelopedSignatureTest
-
public class EnvelopedSignatureTest extends org.opensaml.core.xml.XMLObjectBaseTestCaseTest to verifySignatureand its marshallers and unmarshallers.
-
-
Field Summary
Fields Modifier and Type Field Description private StringalgoURISignature algorithm URI.private org.opensaml.security.credential.CredentialbadCredentialInvalid credential for verification.private org.opensaml.security.credential.CredentialgoodCredentialCredential used to sign and verify.private org.slf4j.LoggerlogClass logger.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 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
-
-
-
-
Field Detail
-
log
private final org.slf4j.Logger log
Class logger.
-
goodCredential
private org.opensaml.security.credential.Credential goodCredential
Credential used to sign and verify.
-
badCredential
private org.opensaml.security.credential.Credential badCredential
Invalid credential for verification.
-
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.
-
algoURI
private String algoURI
Signature algorithm URI.
-
-
Method Detail
-
setUp
@BeforeMethod protected void setUp() throws Exception
- Throws:
Exception
-
testSigningAndVerification
public void testSigningAndVerification() throws org.opensaml.core.xml.io.MarshallingException, javax.xml.bind.ValidationException, org.opensaml.xmlsec.signature.support.SignatureExceptionTests creating an enveloped signature and then verifying it.- Throws:
org.opensaml.core.xml.io.MarshallingException- thrown if the XMLObject tree can not be marshalledjavax.xml.bind.ValidationException- ...org.opensaml.xmlsec.signature.support.SignatureException- ...
-
testUnmarshall
public void testUnmarshall() throws net.shibboleth.utilities.java.support.xml.XMLParserException, org.opensaml.core.xml.io.UnmarshallingException, GeneralSecurityExceptionTests unmarshalling an enveloped signature.- Throws:
net.shibboleth.utilities.java.support.xml.XMLParserException- thrown if the XML can not be parsedorg.opensaml.core.xml.io.UnmarshallingException- 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
-
-