Class PopulateECPContext

  • 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.profile.action.ProfileAction

    public class PopulateECPContext
    extends org.opensaml.profile.action.AbstractConditionalProfileAction
    Action to create and populate an ECPContext based on the request and, when encryption is in use, generating a session key.
    Event:
    EventIds.PROCEED_EVENT_ID, EventIds.INVALID_MSG_CTX
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Function<org.opensaml.profile.context.ProfileRequestContext,​org.opensaml.saml.common.messaging.context.ECPContext> ecpContextCreationStrategy
      Strategy used to locate the ECPContext to populate.
      private Function<org.opensaml.profile.context.ProfileRequestContext,​org.opensaml.saml.saml2.profile.context.EncryptionContext> encryptionContextLookupStrategy
      Strategy used to locate the EncryptionContext.
      private Logger log
      Class logger.
      private SecureRandom randomGenerator
      Random number generator.
      private boolean requireEncryption
      Only generate a key if encryption is expected.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doExecute​(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
      void setECPContextCreationStrategy​(Function<org.opensaml.profile.context.ProfileRequestContext,​org.opensaml.saml.common.messaging.context.ECPContext> strategy)
      Set the strategy used to locate the ECPContext to operate on.
      void setEncryptionContextLookupStrategy​(Function<org.opensaml.profile.context.ProfileRequestContext,​org.opensaml.saml.saml2.profile.context.EncryptionContext> strategy)
      Set the strategy used to locate the EncryptionContext.
      void setRandomGenerator​(SecureRandom generator)
      Set the source of randomness to use, or none to bypass key generation.
      void setRequireEncryption​(boolean flag)
      Set whether to require assertion encryption or skip session key generation.
      • Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction

        doPreExecute, getActivationCondition, setActivationCondition
      • Methods inherited from class org.opensaml.profile.action.AbstractProfileAction

        doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
      • Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent

        destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
      • Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent

        initialize, isInitialized
    • Field Detail

      • log

        @Nonnull
        private final Logger log
        Class logger.
      • ecpContextCreationStrategy

        @Nonnull
        private Function<org.opensaml.profile.context.ProfileRequestContext,​org.opensaml.saml.common.messaging.context.ECPContext> ecpContextCreationStrategy
        Strategy used to locate the ECPContext to populate.
      • encryptionContextLookupStrategy

        @Nonnull
        private Function<org.opensaml.profile.context.ProfileRequestContext,​org.opensaml.saml.saml2.profile.context.EncryptionContext> encryptionContextLookupStrategy
        Strategy used to locate the EncryptionContext.
      • randomGenerator

        @Nullable
        private SecureRandom randomGenerator
        Random number generator.
      • requireEncryption

        private boolean requireEncryption
        Only generate a key if encryption is expected.
    • Method Detail

      • setECPContextCreationStrategy

        public void setECPContextCreationStrategy​(@Nonnull
                                                  Function<org.opensaml.profile.context.ProfileRequestContext,​org.opensaml.saml.common.messaging.context.ECPContext> strategy)
        Set the strategy used to locate the ECPContext to operate on.
        Parameters:
        strategy - lookup strategy
      • setEncryptionContextLookupStrategy

        public void setEncryptionContextLookupStrategy​(@Nonnull
                                                       Function<org.opensaml.profile.context.ProfileRequestContext,​org.opensaml.saml.saml2.profile.context.EncryptionContext> strategy)
        Set the strategy used to locate the EncryptionContext.
        Parameters:
        strategy - lookup strategy
      • setRandomGenerator

        public void setRandomGenerator​(@Nullable
                                       SecureRandom generator)
        Set the source of randomness to use, or none to bypass key generation.
        Parameters:
        generator - random number generator
      • setRequireEncryption

        public void setRequireEncryption​(boolean flag)
        Set whether to require assertion encryption or skip session key generation.
        Parameters:
        flag - flag to set
      • doExecute

        protected void doExecute​(@Nonnull
                                 org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
        Overrides:
        doExecute in class org.opensaml.profile.action.AbstractProfileAction