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
A helper component for processing encrypted content of a
Response.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ResponseData,List<DecryptionConfiguration>> Strategy used to lookup a per-responseDecryptionConfigurationlist.private DecryptionParametersResolverDecryption parameters resolver.private org.slf4j.LoggerLogger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildDecrypter(ResponseData responseData) Build theDecrypterinstance to be used for decryption operations.voiddecryptAssertionContent(Response response, Decrypter decrypter) Decrypt the EncryptedID and EncryptedAttribute elements of a Response.voiddecryptAssertions(Response response, Decrypter decrypter) Decrypt the EncryptedAssertion elements of a Response.voiddecryptEncryptedAttributes(Assertion assertion, Decrypter decrypter) Decrypt the EncryptedAttributes of an Assertion.decryptEncryptedID(EncryptedID encID, Decrypter decrypter) Decrypt an EncryptedID element.voiddecryptEncryptedIDs(Assertion assertion, Decrypter decrypter) Decrypt the EncryptedID elements of an Assertion.protected voidGet the strategy used to look up a per-responseDecryptionConfigurationlist.Get the resolver to use for the parameters to store into the context.booleanhaveEncryptedAssertions(Response response) Determine if the Response has any EncryptedAsseertion elements.booleanhaveEncryptedContent(Response response) Determine if the Response has any EncryptedID or EncryptedAttribute elements.voidsetDecryptionConfigurationLookupStrategy(Function<ResponseData, List<DecryptionConfiguration>> strategy) Set the strategy used to look up a per-responseDecryptionConfigurationlist.voidSet 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
-
Field Details
-
log
private org.slf4j.Logger logLogger. -
decryptionParamsResolver
Decryption parameters resolver. -
decryptionConfigurationLookupStrategy
@NonnullAfterInit private Function<ResponseData,List<DecryptionConfiguration>> decryptionConfigurationLookupStrategyStrategy used to lookup a per-responseDecryptionConfigurationlist.
-
-
Constructor Details
-
DecryptionProcessor
public DecryptionProcessor()
-
-
Method Details
-
getDecryptionParametersResolver
Get the resolver to use for the parameters to store into the context.- Returns:
- the resolver
-
setDecryptionParametersResolver
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-responseDecryptionConfigurationlist.- Returns:
- the strategy
-
setDecryptionConfigurationLookupStrategy
public void setDecryptionConfigurationLookupStrategy(@Nonnull Function<ResponseData, List<DecryptionConfiguration>> strategy) Set the strategy used to look up a per-responseDecryptionConfigurationlist.- Parameters:
strategy- lookup strategy
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
haveEncryptedAssertions
Determine if the Response has any EncryptedAsseertion elements.- Parameters:
response- the Response to process- Returns:
- true if Response contains EncryptedAssertion elements, otherwise false
-
haveEncryptedContent
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
Decrypt the EncryptedAssertion elements of a Response.The resulting decrypted elements are stored in-place in the Response.
- Parameters:
response- the Response to processdecrypter- the decrypter used for decryption operations
-
decryptAssertionContent
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 processdecrypter- 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 processdecrypter- 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 processdecrypter- the decrypter used for decryption operations- Returns:
- the decrypted NameID element
- Throws:
DecryptionException- if there is a fatal error during decryption
-
decryptEncryptedAttributes
Decrypt the EncryptedAttributes of an Assertion.The resulting decrypted elements are stored in-place in the Assertion.
- Parameters:
assertion- the Assertion to processdecrypter- the decrypter to use
-
buildDecrypter
@Nonnull public Decrypter buildDecrypter(@Nonnull ResponseData responseData) throws DecryptionException Build theDecrypterinstance 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
-