Package net.shibboleth.idp.attribute.resolver.dc.saml.util.impl

# Class DecryptionProcessor

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.attribute.resolver.dc.saml.util.impl.DecryptionProcessor

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`

public class DecryptionProcessor extends AbstractInitializableComponent
A helper component for processing encrypted content of a `Response`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Function<ResponseData,List<DecryptionConfiguration>>`
`decryptionConfigurationLookupStrategy`
Strategy used to lookup a per-response `DecryptionConfiguration` list.
`private DecryptionParametersResolver`
`decryptionParamsResolver`
Decryption parameters resolver.
`private org.slf4j.Logger`
`log`
Logger.

## Constructor Summary

Constructors
Constructor
Description
`DecryptionProcessor()`

## Method Summary

Modifier and Type
Method
Description
`Decrypter`
`buildDecrypter(ResponseData responseData)`
Build the `Decrypter` instance to be used for decryption operations.
`void`
`decryptAssertionContent(Response response, Decrypter decrypter)`
Decrypt the EncryptedID and EncryptedAttribute elements of a Response.
`void`
`decryptAssertions(Response response, Decrypter decrypter)`
Decrypt the EncryptedAssertion elements of a Response.
`void`
`decryptEncryptedAttributes(Assertion assertion, Decrypter decrypter)`
Decrypt the EncryptedAttributes of an Assertion.
`NameID`
`decryptEncryptedID(EncryptedID encID, Decrypter decrypter)`
Decrypt an EncryptedID element.
`void`
`decryptEncryptedIDs(Assertion assertion, Decrypter decrypter)`
Decrypt the EncryptedID elements of an Assertion.
`protected void`
`doInitialize()`
`Function<ResponseData,List<DecryptionConfiguration>>`
`getDecryptionConfigurationLookupStrategy()`
Get the strategy used to look up a per-response `DecryptionConfiguration` list.
`DecryptionParametersResolver`
`getDecryptionParametersResolver()`
Get the resolver to use for the parameters to store into the context.
`boolean`
`haveEncryptedAssertions(Response response)`
Determine if the Response has any EncryptedAsseertion elements.
`boolean`
`haveEncryptedContent(Response response)`
Determine if the Response has any EncryptedID or EncryptedAttribute elements.
`void`
`setDecryptionConfigurationLookupStrategy(Function<ResponseData,List<DecryptionConfiguration>> strategy)`
Set the strategy used to look up a per-response `DecryptionConfiguration` list.
`void`
`setDecryptionParametersResolver(DecryptionParametersResolver resolver)`
Set the resolver to use for the parameters to store into the context.

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### log

private org.slf4j.Logger log
Logger.

### decryptionParamsResolver

@NonnullAfterInit private DecryptionParametersResolver decryptionParamsResolver
Decryption parameters resolver.

### decryptionConfigurationLookupStrategy

@NonnullAfterInit private Function<ResponseData,List<DecryptionConfiguration>> decryptionConfigurationLookupStrategy
Strategy used to lookup a per-response `DecryptionConfiguration` list.

## Constructor Details

### DecryptionProcessor

public DecryptionProcessor()

## Method Details

### getDecryptionParametersResolver

@NonnullAfterInit public DecryptionParametersResolver getDecryptionParametersResolver()
Get the resolver to use for the parameters to store into the context.

Returns:
  the resolver

### setDecryptionParametersResolver

public void setDecryptionParametersResolver(@Nonnull DecryptionParametersResolver resolver)
Set the resolver to use for the parameters to store into the context.

Parameters:
  `resolver` - the resolver to use

### getDecryptionConfigurationLookupStrategy

@NonnullAfterInit public Function<ResponseData,List<DecryptionConfiguration>> getDecryptionConfigurationLookupStrategy()
Get the strategy used to look up a per-response `DecryptionConfiguration` list.

Returns:
  the strategy

### setDecryptionConfigurationLookupStrategy

public void setDecryptionConfigurationLookupStrategy(@Nonnull Function<ResponseData,List<DecryptionConfiguration>> strategy)
Set the strategy used to look up a per-response `DecryptionConfiguration` list.

Parameters:
  `strategy` - lookup strategy

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractInitializableComponent`
Throws:
  `ComponentInitializationException`

### haveEncryptedAssertions

public boolean haveEncryptedAssertions(@Nonnull Response response)
Determine if the Response has any EncryptedAsseertion elements.

Parameters:
  `response` - the Response to process
Returns:
  true if Response contains EncryptedAssertion elements, otherwise false

### haveEncryptedContent

public boolean haveEncryptedContent(@Nonnull Response response)
Determine if the Response has any EncryptedID or EncryptedAttribute elements.

Parameters:
  `response` - the Response to process
Returns:
  true if Response contains EncryptedID or EncryptedAttribute elements, otherwise false

### decryptAssertions

public void decryptAssertions(@Nonnull Response response, @Nonnull Decrypter decrypter)
Decrypt the EncryptedAssertion elements of a Response.

The resulting decrypted elements are stored in-place in the Response.

Parameters:
  `response` - the Response to process
  `decrypter` - the decrypter used for decryption operations

### decryptAssertionContent

public void decryptAssertionContent(@Nonnull Response response, @Nonnull Decrypter decrypter)
Decrypt the EncryptedID and EncryptedAttribute elements of a Response.

The resulting decrypted elements are stored in-place in the Response.

Parameters:
  `response` - the Response to process
  `decrypter` - the decrypter used for decryption operations

### decryptEncryptedIDs

public void decryptEncryptedIDs(@Nonnull Assertion assertion, @Nonnull Decrypter decrypter) throws DecryptionException
Decrypt the EncryptedID elements of an Assertion.

The resulting decrypted elements are stored in-place in the Assertion.

Parameters:
  `assertion` - the Assertion to process
  `decrypter` - the decrypter used for decryption operations
Throws:
  `DecryptionException` - there is a fatal error during decryption

### decryptEncryptedID

@Nonnull public NameID decryptEncryptedID(@Nonnull EncryptedID encID, @Nonnull Decrypter decrypter) throws DecryptionException
Decrypt an EncryptedID element.

Parameters:
  `encID` - the EncryptedID to process
  `decrypter` - the decrypter used for decryption operations
Returns:
  the decrypted NameID element
Throws:
  `DecryptionException` - if there is a fatal error during decryption

### decryptEncryptedAttributes

public void decryptEncryptedAttributes(@Nonnull Assertion assertion, @Nonnull Decrypter decrypter)
Decrypt the EncryptedAttributes of an Assertion.

The resulting decrypted elements are stored in-place in the Assertion.

Parameters:
  `assertion` - the Assertion to process
  `decrypter` - the decrypter to use

### buildDecrypter

@Nonnull public Decrypter buildDecrypter(@Nonnull ResponseData responseData) throws DecryptionException
Build the `Decrypter` instance to be used for decryption operations.

Parameters:
  `responseData` - the response data being processed
Returns:
  the new Decrypter instance
Throws:
  `DecryptionException` - if there is a fatal error constructing the Decrypter instance