Class KeyInfoReferenceProvider
- java.lang.Object
-
- org.opensaml.xmlsec.keyinfo.impl.provider.AbstractKeyInfoProvider
-
- org.opensaml.xmlsec.keyinfo.impl.provider.KeyInfoReferenceProvider
-
- All Implemented Interfaces:
KeyInfoProvider
public class KeyInfoReferenceProvider extends AbstractKeyInfoProvider
Implementation ofKeyInfoProvider
which supportsKeyInfoReference
.To prevent cycles, only a single reference step is permitted. Only same-document references are supported.
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.Logger
log
Class logger.
-
Constructor Summary
Constructors Constructor Description KeyInfoReferenceProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected KeyInfoReference
getKeyInfoReference(XMLObject xmlObject)
Get the KeyInfoReference from the passed XML object.boolean
handles(XMLObject keyInfoChild)
Evaluate whether the given provider should attempt to handle resolving a credential from the specified KeyInfo child.Collection<Credential>
process(KeyInfoCredentialResolver resolver, XMLObject keyInfoChild, CriteriaSet criteriaSet, KeyInfoResolutionContext kiContext)
Process a specified KeyInfo child (XMLobject) and attempt to resolve a credential from it.-
Methods inherited from class org.opensaml.xmlsec.keyinfo.impl.provider.AbstractKeyInfoProvider
buildCredentialContext, extractKeyValue
-
-
-
-
Method Detail
-
handles
public boolean handles(@Nonnull XMLObject keyInfoChild)
Evaluate whether the given provider should attempt to handle resolving a credential from the specified KeyInfo child. An evaluation oftrue
does not guarantee that a credential can or will be extracted form the particular KeyInfo child, only that processing should be attempted.- Parameters:
keyInfoChild
- the KeyInfo child object to consider- Returns:
- true if the provider should attempt to resolve credentials, false otherwise
-
process
@Nullable public Collection<Credential> process(@Nonnull KeyInfoCredentialResolver resolver, @Nonnull XMLObject keyInfoChild, @Nullable CriteriaSet criteriaSet, @Nonnull KeyInfoResolutionContext kiContext) throws SecurityException
Process a specified KeyInfo child (XMLobject) and attempt to resolve a credential from it.- Parameters:
resolver
- reference to a resolver which is calling the providerkeyInfoChild
- the KeyInfo child being processedcriteriaSet
- the credential criteria the credential must satisfykiContext
- the resolution context, used for sharing state amongst resolvers and providers- Returns:
- a resolved Credential collection, or null
- Throws:
SecurityException
- if there is an error during credential resolution. Note: failure to resolve a credential is not an error.
-
getKeyInfoReference
@Nullable protected KeyInfoReference getKeyInfoReference(@Nonnull XMLObject xmlObject)
Get the KeyInfoReference from the passed XML object.- Parameters:
xmlObject
- an XML object, presumably aKeyInfoReference
- Returns:
- the KeyInfoReference which was found, or null if none or invalid
-
-