Class SimpleKeyInfoReferenceEncryptedKeyResolver
java.lang.Object
org.opensaml.xmlsec.encryption.support.AbstractEncryptedKeyResolver
org.opensaml.xmlsec.encryption.support.SimpleKeyInfoReferenceEncryptedKeyResolver
- All Implemented Interfaces:
EncryptedKeyResolver
Implementation of
EncryptedKeyResolver which finds EncryptedKey elements by dereferencing
KeyInfoReference children of the KeyInfo of the EncryptedData
context.
The URI attribute value must be a same-document fragment identifier (via ID attribute).
Processing of external resources is not supported. Furthermore, the target of the reference must itself
contain either an EncryptedKey or a subsequent KeyInfoReference, up to a depth limit.
Other forms of resolution cannot be mixed together with this one.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intNumber of times to follow a reference before failing.private final org.slf4j.LoggerClass logger. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.SimpleKeyInfoReferenceEncryptedKeyResolver(String recipient) Deprecated.SimpleKeyInfoReferenceEncryptedKeyResolver(Set<String> recipients) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected KeyInfoDereference the URI attribute of the specified retrieval method into a KeyInfo.intGets the reference depth limit.resolve(EncryptedData encryptedData, Set<String> recipients) Resolve the EncryptedKey elements containing the data encryption key used to encrypt the specified EncryptedData element.protected Iterable<EncryptedKey>resolveKeyInfo(KeyInfo keyInfo, int limit, Set<String> validRecipients) Turn a KeyInfo into an EncryptedKey collection.voidsetDepthLimit(int limit) Sets the reference depth limit, to a minimum of 1.Methods inherited from class org.opensaml.xmlsec.encryption.support.AbstractEncryptedKeyResolver
getEffectiveRecipients, getRecipients, matchCarriedKeyName, matchDataReference, matchRecipientMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensaml.xmlsec.encryption.support.EncryptedKeyResolver
resolve
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
depthLimit
private int depthLimitNumber of times to follow a reference before failing.
-
-
Constructor Details
-
SimpleKeyInfoReferenceEncryptedKeyResolver
public SimpleKeyInfoReferenceEncryptedKeyResolver()Constructor. -
SimpleKeyInfoReferenceEncryptedKeyResolver
Deprecated.Constructor.- Parameters:
recipients- the set of recipients
-
SimpleKeyInfoReferenceEncryptedKeyResolver
Deprecated.Constructor.- Parameters:
recipient- the recipient
-
-
Method Details
-
getDepthLimit
public int getDepthLimit()Gets the reference depth limit.- Returns:
- the depth limit
-
setDepthLimit
public void setDepthLimit(int limit) Sets the reference depth limit, to a minimum of 1.- Parameters:
limit- limit to set
-
resolve
@Nonnull public Iterable<EncryptedKey> resolve(@Nonnull EncryptedData encryptedData, @Nullable Set<String> recipients) Resolve the EncryptedKey elements containing the data encryption key used to encrypt the specified EncryptedData element.- Parameters:
encryptedData- the EncryptedData element context in which to resolverecipients- the recipients to use during resolution- Returns:
- an iterable of EncryptedKey elements
-
resolveKeyInfo
@Nonnull protected Iterable<EncryptedKey> resolveKeyInfo(@Nullable KeyInfo keyInfo, int limit, @Nonnull @NonnullElements @Unmodifiable @NotLive Set<String> validRecipients) Turn a KeyInfo into an EncryptedKey collection.- Parameters:
keyInfo- KeyInfo to processlimit- depth of references to followvalidRecipients- recipients to consider valid for matching purposes.- Returns:
- encrypted keys
-
dereferenceURI
Dereference the URI attribute of the specified retrieval method into a KeyInfo.- Parameters:
ref- the KeyInfoReference to process- Returns:
- the dereferenced KeyInfo
-