Package org.opensaml.xmlsec.encryption.support

# Class AbstractEncryptedKeyResolver

java.lang.Object
org.opensaml.xmlsec.encryption.support.AbstractEncryptedKeyResolver

All Implemented Interfaces:
  `EncryptedKeyResolver`

Direct Known Subclasses:
  `ChainingEncryptedKeyResolver`, `EncryptedElementTypeEncryptedKeyResolver`, `InlineEncryptedKeyResolver`, `SimpleKeyInfoReferenceEncryptedKeyResolver`, `SimpleRetrievalMethodEncryptedKeyResolver`

public abstract class AbstractEncryptedKeyResolver extends Object implements EncryptedKeyResolver
Abstract class implementation for `EncryptedKeyResolver`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final Set<String>`
`recipients`
Recipient attribute criteria against which to match.

## Constructor Summary

Constructors
Constructor
Description
`AbstractEncryptedKeyResolver()`
Constructor.
`AbstractEncryptedKeyResolver(String recipient)`
Constructor.
`AbstractEncryptedKeyResolver(Set<String> newRecipents)`
Deprecated.

## Method Summary

Modifier and Type
Method
Description
`protected Set<String>`
`getEffectiveRecipients(Set<String> values)`
Get the effective set of recipients by merging the passed recipients set with the static set of recipients possibly configured on this resolver instance.
`Set<String>`
`getRecipients()`
Deprecated.
`protected boolean`
`matchCarriedKeyName(EncryptedData encryptedData, EncryptedKey encryptedKey)`
Evaluate whether an EncryptedKey's CarriedKeyName matches one of the KeyName values from the EncryptedData context.
`protected boolean`
`matchDataReference(EncryptedData encryptedData, EncryptedKey encryptedKey)`
Evaluate whether any of the EncryptedKey's DataReferences refer to the EncryptedData context.
`protected boolean`
`matchRecipient(String recipient, Set<String> validRecipients)`
Evaluate whether the specified recipient attribute value matches this resolver's recipient criteria.

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

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

### Methods inherited from interface org.opensaml.xmlsec.encryption.support.EncryptedKeyResolver

`resolve, resolve`

## Field Details

### recipients

@Nonnull private final Set<String> recipients
Recipient attribute criteria against which to match.

## Constructor Details

### AbstractEncryptedKeyResolver

public AbstractEncryptedKeyResolver()
Constructor.

### AbstractEncryptedKeyResolver

@Deprecated public AbstractEncryptedKeyResolver(@Nullable Set<String> newRecipents)
Deprecated.
Constructor.

Parameters:
  `newRecipents` - set of recipients

### AbstractEncryptedKeyResolver

public AbstractEncryptedKeyResolver(@Nullable String recipient)
Constructor.

Parameters:
  `recipient` - the recipient

## Method Details

### getRecipients

@Deprecated @Nonnull @Unmodifiable @NotLive public Set<String> getRecipients()
Deprecated.
Get the set of recipient criteria used by this resolver, and against which a candidate EncryptedKey's Recipient attribute is evaluated.

Specified by:
  `getRecipients` in interface `EncryptedKeyResolver`
Returns:
  the collection of recipient criteria

### getEffectiveRecipients

@Nonnull @Unmodifiable @NotLive protected Set<String> getEffectiveRecipients(@Nullable Set<String> values)
Get the effective set of recipients by merging the passed recipients set with the static set of recipients possibly configured on this resolver instance.

Parameters:
  `values` - the recipients argument
Returns:
  the merged recipients

### matchRecipient

protected boolean matchRecipient(@Nullable String recipient, @Nonnull Set<String> validRecipients)
Evaluate whether the specified recipient attribute value matches this resolver's recipient criteria.

Parameters:
  `recipient` - the recipient value to evaluate
  `validRecipients` - recipients to consider valid for matching purposes. If empty, then all recipients match
Returns:
  true if the recipient value matches the resolver's criteria, false otherwise

### matchCarriedKeyName

protected boolean matchCarriedKeyName(@Nonnull EncryptedData encryptedData, @Nonnull EncryptedKey encryptedKey)
Evaluate whether an EncryptedKey's CarriedKeyName matches one of the KeyName values from the EncryptedData context.

Parameters:
  `encryptedData` - the EncryptedData context
  `encryptedKey` - the candidate Encryptedkey to evaluate
Returns:
  true if the encrypted key's carried key name matches that of the encrytped data, false otherwise

### matchDataReference

protected boolean matchDataReference(@Nonnull EncryptedData encryptedData, @Nonnull EncryptedKey encryptedKey)
Evaluate whether any of the EncryptedKey's DataReferences refer to the EncryptedData context.

Parameters:
  `encryptedData` - the EncryptedData context
  `encryptedKey` - the candidate Encryptedkey to evaluate
Returns:
  true if any of the encrypted key's data references refer to the encrypted data context, false otherwise