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 Details

  • 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