public class HTTPPostSimpleSignEncoder extends HTTPPostEncoder
The spec does not preclude the SAML 2 protocol message from being signed using the XML Signature method, in addition
to the SimpleSign method specified by this binding. Signing via XML Signature over the SAML request and response
payload may be toggled by the signXMLProtocolMessage parameter to the constructor
HTTPPostSimpleSignEncoder#HTTPPostSimpleSignEncoder(VelocityEngine, String, boolean). If this constructor
variant is not used, the flag defaults to false.
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_TEMPLATE_ID
Default template ID.
|
private Logger |
log
Class logger.
|
| Constructor and Description |
|---|
HTTPPostSimpleSignEncoder()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildFormDataToSign(VelocityContext velocityContext,
org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext,
String sigAlgURI)
Build the form control data string over which the signature is computed.
|
protected String |
buildKeyInfo(org.opensaml.security.credential.Credential signingCredential,
org.opensaml.xmlsec.keyinfo.KeyInfoGenerator kiGenerator)
Build the
KeyInfo from the signing credential. |
protected String |
generateSignature(org.opensaml.security.credential.Credential signingCredential,
String algorithmURI,
String formData)
Generates the signature over the string of concatenated form control data as indicated by the SimpleSign spec.
|
String |
getBindingURI() |
protected String |
getSignatureAlgorithmURI(org.opensaml.xmlsec.SignatureSigningParameters signingParameters)
Gets the signature algorithm URI to use.
|
protected void |
populateVelocityContext(VelocityContext velocityContext,
org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext,
String endpointURL)
Populate the Velocity context instance which will be used to render the POST body.
|
doDestroy, doEncode, doInitialize, getVelocityEngine, getVelocityTemplateId, postEncode, providesMessageConfidentiality, providesMessageIntegrity, setVelocityEngine, setVelocityTemplateIdgetEndpointURLencode, getMessageToLog, logEncodedMessage, marshallMessagegetHttpServletResponse, setHttpServletResponsegetMessageContext, prepareContext, setMessageContextdestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitencode, prepareContext, setMessageContextpublic static final String DEFAULT_TEMPLATE_ID
private final Logger log
public String getBindingURI()
getBindingURI in interface SAMLMessageEncodergetBindingURI in class HTTPPostEncoderprotected void populateVelocityContext(VelocityContext velocityContext, org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext, String endpointURL) throws org.opensaml.messaging.encoder.MessageEncodingException
populateVelocityContext in class HTTPPostEncodervelocityContext - the Velocity context instance to populate with datamessageContext - the SAML message context source of dataendpointURL - endpoint URL to which to encode messageorg.opensaml.messaging.encoder.MessageEncodingException - thrown if there is a problem encoding the messageprotected String buildKeyInfo(org.opensaml.security.credential.Credential signingCredential, org.opensaml.xmlsec.keyinfo.KeyInfoGenerator kiGenerator) throws org.opensaml.messaging.encoder.MessageEncodingException
KeyInfo from the signing credential.signingCredential - the credential used for signingkiGenerator - the generator for the KeyInfoorg.opensaml.messaging.encoder.MessageEncodingException - thrown if there is an error generating or marshalling the KeyInfoprotected String buildFormDataToSign(VelocityContext velocityContext, org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext, String sigAlgURI)
velocityContext - the Velocity context which is already populated with the values for SAML message and relay
statemessageContext - the SAML message context being processedsigAlgURI - the signature algorithm URIprotected String getSignatureAlgorithmURI(org.opensaml.xmlsec.SignatureSigningParameters signingParameters) throws org.opensaml.messaging.encoder.MessageEncodingException
signingParameters - the signing parameters to useorg.opensaml.messaging.encoder.MessageEncodingException - thrown if the algorithm URI is not supplied explicitly and
could not be derived from the supplied credentialprotected String generateSignature(org.opensaml.security.credential.Credential signingCredential, String algorithmURI, String formData) throws org.opensaml.messaging.encoder.MessageEncodingException
signingCredential - credential that will be used to signalgorithmURI - algorithm URI of the signing credentialformData - form control data to be signedorg.opensaml.messaging.encoder.MessageEncodingException - there is an error computing the signatureCopyright © 1999–2014. All rights reserved.