public class HTTPPostSimpleSignEncoder extends HTTPPostEncoder
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_TEMPLATE_ID
Default template ID.
|
private org.slf4j.Logger |
log
Class logger.
|
| Constructor and Description |
|---|
HTTPPostSimpleSignEncoder()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
buildFormDataToSign(org.apache.velocity.VelocityContext velocityContext,
MessageContext<SAMLObject> messageContext,
java.lang.String sigAlgURI)
Build the form control data string over which the signature is computed.
|
protected java.lang.String |
buildKeyInfo(Credential signingCredential,
KeyInfoGenerator kiGenerator)
Build the
KeyInfo from the signing credential. |
protected java.lang.String |
generateSignature(Credential signingCredential,
java.lang.String algorithmURI,
java.lang.String formData)
Generates the signature over the string of concatenated form control data as indicated by the SimpleSign spec.
|
java.lang.String |
getBindingURI()
Gets the SAML binding URI supported by this encoder.
|
protected java.lang.String |
getSignatureAlgorithmURI(SignatureSigningParameters signingParameters)
Gets the signature algorithm URI to use.
|
protected void |
populateVelocityContext(org.apache.velocity.VelocityContext velocityContext,
MessageContext<SAMLObject> messageContext,
java.lang.String endpointURL)
Populate the Velocity context instance which will be used to render the POST body.
|
doDestroy, doEncode, doInitialize, getVelocityEngine, getVelocityTemplateId, postEncode, 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 java.lang.String DEFAULT_TEMPLATE_ID
private final org.slf4j.Logger log
public java.lang.String getBindingURI()
getBindingURI in interface SAMLMessageEncodergetBindingURI in class HTTPPostEncoderprotected void populateVelocityContext(org.apache.velocity.VelocityContext velocityContext,
MessageContext<SAMLObject> messageContext,
java.lang.String endpointURL)
throws 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 messageMessageEncodingException - thrown if there is a problem encoding the messageprotected java.lang.String buildKeyInfo(Credential signingCredential, KeyInfoGenerator kiGenerator) throws MessageEncodingException
KeyInfo from the signing credential.signingCredential - the credential used for signingkiGenerator - the generator for the KeyInfoMessageEncodingException - thrown if there is an error generating or marshalling the KeyInfoprotected java.lang.String buildFormDataToSign(org.apache.velocity.VelocityContext velocityContext,
MessageContext<SAMLObject> messageContext,
java.lang.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 java.lang.String getSignatureAlgorithmURI(SignatureSigningParameters signingParameters) throws MessageEncodingException
signingParameters - the signing parameters to useMessageEncodingException - thrown if the algorithm URI is not supplied explicitly and
could not be derived from the supplied credentialprotected java.lang.String generateSignature(Credential signingCredential, java.lang.String algorithmURI, java.lang.String formData) throws MessageEncodingException
signingCredential - credential that will be used to signalgorithmURI - algorithm URI of the signing credentialformData - form control data to be signedMessageEncodingException - there is an error computing the signature