public class HTTPPostSimpleSignEncoder extends HTTPPostEncoder
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_TEMPLATE_ID
Default template ID.
|
Constructor and Description |
---|
HTTPPostSimpleSignEncoder()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected String |
buildFormDataToSign(org.apache.velocity.VelocityContext velocityContext,
MessageContext<SAMLObject> messageContext,
String sigAlgURI)
Build the form control data string over which the signature is computed.
|
protected String |
buildKeyInfo(Credential signingCredential,
KeyInfoGenerator kiGenerator)
Build the
KeyInfo from the signing credential. |
protected String |
generateSignature(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()
Gets the SAML binding URI supported by this encoder.
|
protected String |
getSignatureAlgorithmURI(SignatureSigningParameters signingParameters)
Gets the signature algorithm URI to use.
|
protected void |
populateVelocityContext(org.apache.velocity.VelocityContext velocityContext,
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, setVelocityEngine, setVelocityTemplateId
getEndpointURL
encode, getMessageToLog, logEncodedMessage, marshallMessage
getHttpServletResponse, setHttpServletResponse
getMessageContext, prepareContext, setMessageContext
destroy, initialize, isDestroyed, isInitialized
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
encode, prepareContext, setMessageContext
public static final String DEFAULT_TEMPLATE_ID
public String getBindingURI()
getBindingURI
in interface SAMLMessageEncoder
getBindingURI
in class HTTPPostEncoder
protected void populateVelocityContext(org.apache.velocity.VelocityContext velocityContext, MessageContext<SAMLObject> messageContext, String endpointURL) throws MessageEncodingException
populateVelocityContext
in class HTTPPostEncoder
velocityContext
- 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 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 String buildFormDataToSign(org.apache.velocity.VelocityContext velocityContext, 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(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 String generateSignature(Credential signingCredential, String algorithmURI, 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 signatureCopyright © 2016. All rights reserved.