public class HMACSignatureTest
extends org.opensaml.core.xml.XMLObjectBaseTestCase
Signature and its marshallers and unmarshallers.| Modifier and Type | Field and Description |
|---|---|
private String |
algoURI
Signature algorithm URI.
|
private org.opensaml.security.credential.Credential |
badCredential
Invalid credential for verification.
|
private String |
expectedKeyName
Expected key name value in KeyInfo.
|
private org.opensaml.security.credential.Credential |
goodCredential
Credential used to sign and verify.
|
private Integer |
hmacOutputLength
Value of HMACOutputLength element child of SignatureMethod.
|
private org.opensaml.xmlsec.signature.impl.KeyInfoBuilder |
keyInfoBuilder
Build of KeyInfo objects.
|
private Logger |
log
Class logger.
|
private org.opensaml.xmlsec.signature.impl.SignatureBuilder |
sigBuilder
Builder of Signature XML objects.
|
private SignableSimpleXMLObjectBuilder |
sxoBuilder
Builder of mock XML objects.
|
| Constructor and Description |
|---|
HMACSignatureTest() |
| Modifier and Type | Method and Description |
|---|---|
private SignableSimpleXMLObject |
getXMLObjectWithSignature(boolean useHMACOutputLength)
Creates a XMLObject that has a Signature child element.
|
protected void |
setUp() |
void |
testMarshallNoOutputLength()
Tests marshalling with SignatureMethod/HMACOutputLength not present.
|
void |
testMarshallWithOutputLength()
Tests marshalling with SignatureMethod/HMACOutputLength present.
|
void |
testSigningAndVerificationNoOutputLength()
Tests creating an enveloped signature and then verifying it.
|
void |
testSigningAndVerificationWithOutputLength()
Tests creating an enveloped signature and then verifying it.
|
void |
testUnmarshallNoOutputLength()
Tests unmarshalling with SignatureMethod/HMACOutputLength not present.
|
void |
testUnmarshallWithOutputLength()
Tests unmarshalling with SignatureMethod/HMACOutputLength present.
|
assertXMLEquals, assertXMLEquals, buildXMLObject, fetchDuration, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElementprivate final Logger log
private org.opensaml.security.credential.Credential goodCredential
private org.opensaml.security.credential.Credential badCredential
private SignableSimpleXMLObjectBuilder sxoBuilder
private org.opensaml.xmlsec.signature.impl.SignatureBuilder sigBuilder
private org.opensaml.xmlsec.signature.impl.KeyInfoBuilder keyInfoBuilder
private Integer hmacOutputLength
private String expectedKeyName
private String algoURI
public void testSigningAndVerificationNoOutputLength()
throws org.opensaml.core.xml.io.MarshallingException,
ValidationException,
org.opensaml.xmlsec.signature.support.SignatureException
org.opensaml.core.xml.io.MarshallingException - thrown if the XMLObject tree can not be marshalledValidationException - thrown if signature validator fails to validate the signatureSignatureExceptionpublic void testSigningAndVerificationWithOutputLength()
throws org.opensaml.core.xml.io.MarshallingException,
org.opensaml.xmlsec.signature.support.SignatureException
org.opensaml.core.xml.io.MarshallingException - thrown if the XMLObject tree can not be marshalledValidationException - thrown if signature validator fails to validate the signatureSignatureExceptionpublic void testUnmarshallNoOutputLength()
throws net.shibboleth.utilities.java.support.xml.XMLParserException,
org.opensaml.core.xml.io.UnmarshallingException
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 unmarshalledpublic void testUnmarshallWithOutputLength()
throws net.shibboleth.utilities.java.support.xml.XMLParserException,
org.opensaml.core.xml.io.UnmarshallingException
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 unmarshalledpublic void testMarshallNoOutputLength()
throws org.opensaml.core.xml.io.MarshallingException
org.opensaml.core.xml.io.MarshallingException - thrown in signed object can't be marshalledpublic void testMarshallWithOutputLength()
throws org.opensaml.core.xml.io.MarshallingException
org.opensaml.core.xml.io.MarshallingException - thrown in signed object can't be marshalledprivate SignableSimpleXMLObject getXMLObjectWithSignature(boolean useHMACOutputLength)
useHMACOutputLength - if true, set value for HMACOutputLengthCopyright © 1999–2015. All rights reserved.