public abstract class BaseSAMLSimpleSignatureSecurityHandler extends AbstractMessageHandler
Constructor and Description |
---|
BaseSAMLSimpleSignatureSecurityHandler() |
Modifier and Type | Method and Description |
---|---|
protected net.shibboleth.utilities.java.support.resolver.CriteriaSet |
buildCriteriaSet(String entityID,
MessageContext messageContext)
Build a criteria set suitable for input to the trust engine.
|
protected String |
deriveSignerEntityID(MessageContext messageContext)
Derive the signer's entity ID from the message context.
|
protected void |
doInitialize() |
protected void |
doInvoke(MessageContext messageContext)
Performs the handler logic.
|
protected boolean |
doPreInvoke(MessageContext messageContext)
Called prior to execution, handlers may override this method to perform pre-processing for a request.
|
javax.servlet.http.HttpServletRequest |
getHttpServletRequest()
Get the HTTP servlet request being processed.
|
protected List<Credential> |
getRequestCredentials(MessageContext messageContext)
Extract any candidate validation credentials from the request and/or message context.
|
protected byte[] |
getSignature()
Extract the signature value from the request, in the form suitable for input into
SignatureTrustEngine.validate(byte[], byte[], String, CriteriaSet, Credential) . |
protected String |
getSignatureAlgorithm()
Extract the signature algorithm URI value from the request.
|
protected abstract byte[] |
getSignedContent()
Get the content over which to validate the signature, in the form suitable for input into
SignatureTrustEngine.validate(byte[], byte[], String, CriteriaSet, Credential) . |
protected SignatureTrustEngine |
getTrustEngine()
Gets the engine used to validate the signature.
|
protected abstract boolean |
ruleHandles(MessageContext messageContext)
Determine whether the rule should handle the request, based on the unwrapped HTTP servlet request and/or message
context.
|
void |
setHttpServletRequest(javax.servlet.http.HttpServletRequest request)
Set the HTTP servlet request being processed.
|
protected boolean |
validateSignature(byte[] signature,
byte[] signedContent,
String algorithmURI,
net.shibboleth.utilities.java.support.resolver.CriteriaSet criteriaSet,
List<Credential> candidateCredentials)
Validate the simple signature.
|
doPostInvoke, doPostInvoke, getLogPrefix, invoke
destroy, doDestroy, initialize, isDestroyed, isInitialized
public BaseSAMLSimpleSignatureSecurityHandler()
@Nullable protected SignatureTrustEngine getTrustEngine()
@NonnullAfterInit public javax.servlet.http.HttpServletRequest getHttpServletRequest()
public void setHttpServletRequest(@Nonnull javax.servlet.http.HttpServletRequest request)
request
- The to set.protected void doInitialize() throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize
in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
net.shibboleth.utilities.java.support.component.ComponentInitializationException
protected boolean doPreInvoke(@Nonnull MessageContext messageContext) throws MessageHandlerException
If false is returned, execution will not proceed.
If returning successfully, the last step should be to return the result of the superclass version of this method.
doPreInvoke
in class AbstractMessageHandler
messageContext
- the message context on which to invoke the handlerMessageHandlerException
- if there is a problem executing the handler pre-routineprotected void doInvoke(@Nonnull MessageContext messageContext) throws MessageHandlerException
doInvoke
in class AbstractMessageHandler
messageContext
- the message context on which to invoke the handlerMessageHandlerException
- if there is an error invoking the handler on the message contextprotected boolean validateSignature(@Nonnull @NotEmpty byte[] signature, @Nonnull @NotEmpty byte[] signedContent, @Nonnull @NotEmpty String algorithmURI, @Nonnull net.shibboleth.utilities.java.support.resolver.CriteriaSet criteriaSet, @Nonnull @NonnullElements List<Credential> candidateCredentials) throws MessageHandlerException
signature
- the signature valuesignedContent
- the content that was signedalgorithmURI
- the signature algorithm URI which was used to sign the contentcriteriaSet
- criteria used to describe and/or resolve the information which serves as the basis for trust
evaluationcandidateCredentials
- the request-derived candidate credential(s) containing the validation key for the
signature (optional)MessageHandlerException
- thrown if there are errors during the signature validation process@Nonnull @NonnullElements protected List<Credential> getRequestCredentials(@Nonnull MessageContext messageContext) throws MessageHandlerException
messageContext
- the SAML message context being processedMessageHandlerException
- thrown if there is an error during request processing@Nullable protected byte[] getSignature() throws MessageHandlerException
SignatureTrustEngine.validate(byte[], byte[], String, CriteriaSet, Credential)
.
Defaults to the Base64-decoded value of the HTTP request parameter named Signature
.MessageHandlerException
- thrown if there is an error during request processing@Nullable protected String getSignatureAlgorithm() throws MessageHandlerException
SigAlg
.MessageHandlerException
- thrown if there is an error during request processing@Nullable protected String deriveSignerEntityID(@Nonnull MessageContext messageContext) throws MessageHandlerException
messageContext
- the SAML message context being processedMessageHandlerException
- thrown if there is an error during request processing@Nonnull protected net.shibboleth.utilities.java.support.resolver.CriteriaSet buildCriteriaSet(@Nullable String entityID, @Nonnull MessageContext messageContext) throws MessageHandlerException
entityID
- the candidate issuer entity ID which is being evaluatedmessageContext
- the message context which is being evaluatedMessageHandlerException
- thrown if criteria set can not be constructed@Nullable protected abstract byte[] getSignedContent() throws MessageHandlerException
SignatureTrustEngine.validate(byte[], byte[], String, CriteriaSet, Credential)
.MessageHandlerException
- thrown if there is an error during request processingprotected abstract boolean ruleHandles(@Nonnull MessageContext messageContext) throws MessageHandlerException
messageContext
- the SAML message context being processedMessageHandlerException
- thrown if there is an error during request processingCopyright © 2018. All rights reserved.