public abstract class AbstractEncryptAction extends AbstractConditionalProfileAction
The EncryptionContext governing the encryption process is located by a lookup
strategy, by default a child of the outbound message context.
An optional recipient name is also obtained from a lookup strategy.
| Modifier and Type | Field and Description |
|---|---|
private Encrypter |
encrypter
The encryption object.
|
private com.google.common.base.Function<ProfileRequestContext,EncryptionContext> |
encryptionCtxLookupStrategy
Strategy used to locate the
EncryptionContext. |
private com.google.common.base.Function<ProfileRequestContext,Encrypter.KeyPlacement> |
keyPlacementLookupStrategy
Strategy used to determine encrypted key placement.
|
private org.slf4j.Logger |
log
Class logger.
|
private com.google.common.base.Function<ProfileRequestContext,java.lang.String> |
recipientLookupStrategy
Strategy used to locate the encryption recipient.
|
| Constructor and Description |
|---|
AbstractEncryptAction()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
doPreExecute(ProfileRequestContext profileRequestContext)
Called prior to execution, actions may override this method to perform pre-processing for a request.
|
protected abstract EncryptionParameters |
getApplicableParameters(EncryptionContext ctx)
Return the right set of parameters for the operation to be performed, or none if no encryption should occur.
|
Encrypter |
getEncrypter()
Get the encrypter.
|
void |
setEncryptionContextLookupStrategy(com.google.common.base.Function<ProfileRequestContext,EncryptionContext> strategy)
Set the strategy used to locate the
EncryptionContext associated with a given
ProfileRequestContext. |
void |
setKeyPlacementLookupStrategy(com.google.common.base.Function<ProfileRequestContext,Encrypter.KeyPlacement> strategy)
Set the strategy used to determine the encrypted key placement strategy.
|
void |
setRecipientLookupStrategy(com.google.common.base.Function<ProfileRequestContext,java.lang.String> strategy)
Set the strategy used to locate the encryption recipient.
|
getActivationCondition, setActivationConditiondoExecute, doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponsedestroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized@Nonnull private final org.slf4j.Logger log
@Nonnull private com.google.common.base.Function<ProfileRequestContext,EncryptionContext> encryptionCtxLookupStrategy
EncryptionContext.@Nullable private com.google.common.base.Function<ProfileRequestContext,java.lang.String> recipientLookupStrategy
@Nonnull private com.google.common.base.Function<ProfileRequestContext,Encrypter.KeyPlacement> keyPlacementLookupStrategy
@Nullable private Encrypter encrypter
public void setEncryptionContextLookupStrategy(@Nonnull
com.google.common.base.Function<ProfileRequestContext,EncryptionContext> strategy)
EncryptionContext associated with a given
ProfileRequestContext.strategy - lookup strategypublic void setRecipientLookupStrategy(@Nonnull
com.google.common.base.Function<ProfileRequestContext,java.lang.String> strategy)
strategy - lookup strategypublic void setKeyPlacementLookupStrategy(@Nonnull
com.google.common.base.Function<ProfileRequestContext,Encrypter.KeyPlacement> strategy)
strategy - lookup strategy@Nullable public Encrypter getEncrypter()
protected boolean doPreExecute(@Nonnull
ProfileRequestContext profileRequestContext)
If false is returned, execution will not proceed, and the action should attach an
EventContext to the context tree to signal how to continue with overall
workflow processing.
If returning successfully, the last step should be to return the result of the superclass version of this method.
doPreExecute in class AbstractConditionalProfileActionprofileRequestContext - the current IdP profile request context@Nullable protected abstract EncryptionParameters getApplicableParameters(@Nullable EncryptionContext ctx)
ctx - possibly null input context to pull parameters from