Class SAML2HTTPPostSimpleSignSecurityHandler
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.messaging.handler.AbstractMessageHandler
-
- org.opensaml.saml.common.binding.security.impl.BaseSAMLSimpleSignatureSecurityHandler
-
- org.opensaml.saml.saml2.binding.security.impl.SAML2HTTPPostSimpleSignSecurityHandler
-
- All Implemented Interfaces:
net.shibboleth.utilities.java.support.component.Component,net.shibboleth.utilities.java.support.component.DestructableComponent,net.shibboleth.utilities.java.support.component.InitializableComponent,org.opensaml.messaging.handler.MessageHandler
public class SAML2HTTPPostSimpleSignSecurityHandler extends BaseSAMLSimpleSignatureSecurityHandler
Message handler which evaluates simple "blob" signatures according to the SAML 2 HTTP-POST-SimpleSign binding.
-
-
Field Summary
Fields Modifier and Type Field Description private org.opensaml.xmlsec.keyinfo.KeyInfoCredentialResolverkeyInfoResolverKeyInfo resolver to use to process KeyInfo request parameter.private LoggerlogLogger.private net.shibboleth.utilities.java.support.xml.ParserPoolparserPoolParser pool to use to process KeyInfo request parameter.
-
Constructor Summary
Constructors Constructor Description SAML2HTTPPostSimpleSignSecurityHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInitialize()org.opensaml.xmlsec.keyinfo.KeyInfoCredentialResolvergetKeyInfoResolver()Get the KeyInfo credential resolver.net.shibboleth.utilities.java.support.xml.ParserPoolgetParserPool()Get the parser pool.protected List<org.opensaml.security.credential.Credential>getRequestCredentials(org.opensaml.messaging.context.MessageContext samlContext)Extract any candidate validation credentials from the request and/or message context.protected byte[]getSignedContent()Get the content over which to validate the signature, in the form suitable for input intoSignatureTrustEngine.validate(byte[], byte[], String, CriteriaSet, Credential).protected booleanruleHandles(org.opensaml.messaging.context.MessageContext messageContext)Determine whether the rule should handle the request, based on the unwrapped HTTP servlet request and/or message context.voidsetKeyInfoResolver(org.opensaml.xmlsec.keyinfo.KeyInfoCredentialResolver newKeyInfoResolver)Set the KeyInfo credential resolver.voidsetParser(net.shibboleth.utilities.java.support.xml.ParserPool newParserPool)Set the parser pool.-
Methods inherited from class org.opensaml.saml.common.binding.security.impl.BaseSAMLSimpleSignatureSecurityHandler
buildCriteriaSet, deriveSignerEntityID, doInvoke, doPreInvoke, getHttpServletRequest, getSignature, getSignatureAlgorithm, getTrustEngine, setHttpServletRequest, validateSignature
-
Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doPostInvoke, doPostInvoke, getActivationCondition, getLogPrefix, invoke, setActivationCondition
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
log
@Nonnull private Logger log
Logger.
-
parserPool
@NonnullAfterInit private net.shibboleth.utilities.java.support.xml.ParserPool parserPool
Parser pool to use to process KeyInfo request parameter.
-
keyInfoResolver
@NonnullAfterInit private org.opensaml.xmlsec.keyinfo.KeyInfoCredentialResolver keyInfoResolver
KeyInfo resolver to use to process KeyInfo request parameter.
-
-
Method Detail
-
getParserPool
@NonnullAfterInit public net.shibboleth.utilities.java.support.xml.ParserPool getParserPool()
Get the parser pool.- Returns:
- Returns the parser pool.
-
setParser
public void setParser(@Nonnull net.shibboleth.utilities.java.support.xml.ParserPool newParserPool)Set the parser pool.- Parameters:
newParserPool- The parser to set.
-
getKeyInfoResolver
@NonnullAfterInit public org.opensaml.xmlsec.keyinfo.KeyInfoCredentialResolver getKeyInfoResolver()
Get the KeyInfo credential resolver.- Returns:
- Returns the keyInfoResolver.
-
setKeyInfoResolver
public void setKeyInfoResolver(@Nonnull org.opensaml.xmlsec.keyinfo.KeyInfoCredentialResolver newKeyInfoResolver)Set the KeyInfo credential resolver.- Parameters:
newKeyInfoResolver- The keyInfoResolver to set.
-
doInitialize
protected void doInitialize() throws net.shibboleth.utilities.java.support.component.ComponentInitializationException- Overrides:
doInitializein classBaseSAMLSimpleSignatureSecurityHandler- Throws:
net.shibboleth.utilities.java.support.component.ComponentInitializationException
-
ruleHandles
protected boolean ruleHandles(@Nonnull org.opensaml.messaging.context.MessageContext messageContext)Determine whether the rule should handle the request, based on the unwrapped HTTP servlet request and/or message context.- Specified by:
ruleHandlesin classBaseSAMLSimpleSignatureSecurityHandler- Parameters:
messageContext- the SAML message context being processed- Returns:
- true if the rule should attempt to process the request, otherwise false
-
getSignedContent
@Nullable protected byte[] getSignedContent() throws org.opensaml.messaging.handler.MessageHandlerExceptionGet the content over which to validate the signature, in the form suitable for input intoSignatureTrustEngine.validate(byte[], byte[], String, CriteriaSet, Credential).- Specified by:
getSignedContentin classBaseSAMLSimpleSignatureSecurityHandler- Returns:
- the signed content extracted from the request, in the format suitable for input to the trust engine.
- Throws:
org.opensaml.messaging.handler.MessageHandlerException- thrown if there is an error during request processing
-
getRequestCredentials
@Nonnull @NonnullElements protected List<org.opensaml.security.credential.Credential> getRequestCredentials(@Nonnull org.opensaml.messaging.context.MessageContext samlContext) throws org.opensaml.messaging.handler.MessageHandlerException
Extract any candidate validation credentials from the request and/or message context. Some bindings allow validataion keys for the simple signature to be supplied, and others do not.- Overrides:
getRequestCredentialsin classBaseSAMLSimpleSignatureSecurityHandler- Parameters:
samlContext- the SAML message context being processed- Returns:
- a list of candidate validation credentials in the request, or null if none were present
- Throws:
org.opensaml.messaging.handler.MessageHandlerException- thrown if there is an error during request processing
-
-