public class LocalKeyInfoCredentialResolver extends BasicProviderKeyInfoCredentialResolver
BasicProviderKeyInfoCredentialResolver
which is capable of using information from a KeyInfo to resolve
local credentials from a supplied CredentialResolver which manages local credentials.
The local credential resolver supplied should manage and return credentials which contain either a secret (symmetric) key or the private key half of a key pair.
A typical use case for this class would be as a resolver of decryption keys,
such as is needed by Decrypter.
Resolution proceeds as follows:
BasicProviderKeyInfoCredentialResolver
resolution process which is not a local credential will be removed
from the effective set of credentials to be returned. Note that a configured
KeyInfoProvider may have itself already resolved local credentials using a
different mechanism. These will not be removed.KeyInfoResolutionContext.getKeyNames() will also
be used as resolution criteria for local credentials and the resultant credentials
added to the set to be returned.| Modifier and Type | Field and Description |
|---|---|
private CredentialResolver |
localCredResolver
The resolver which is used to resolve local credentials.
|
| Constructor and Description |
|---|
LocalKeyInfoCredentialResolver(java.util.List<KeyInfoProvider> keyInfoProviders,
CredentialResolver localCredentialResolver)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
CredentialResolver |
getLocalCredentialResolver()
Get the resolver for local credentials.
|
protected boolean |
isLocalCredential(Credential credential)
Determine whether the credential is a local credential.
|
protected void |
postProcess(KeyInfoResolutionContext kiContext,
net.shibboleth.utilities.java.support.resolver.CriteriaSet criteriaSet,
java.util.List<Credential> credentials)
Hook for subclasses to do post-processing of the credential set after all KeyInfo children have been processed.
|
protected java.util.Collection<? extends Credential> |
resolveByKeyName(java.lang.String keyName)
Resolve credentials from local resolver using key name criteria.
|
protected java.util.Collection<? extends Credential> |
resolveByPublicKey(java.security.PublicKey publicKey)
Resolve credentials from local resolver using public key criteria.
|
buildBasicCredential, extractKeyValue, getProviders, initResolutionContext, postProcessEmptyCredentials, processKeyInfoChild, processKeyInfoChildren, resolveFromSource, resolveKeyValueisSatisfyAllPredicates, resolve, setSatisfyAllPredicatesresolveSingleprivate final CredentialResolver localCredResolver
public LocalKeyInfoCredentialResolver(@Nonnull
java.util.List<KeyInfoProvider> keyInfoProviders,
@Nonnull
CredentialResolver localCredentialResolver)
keyInfoProviders - the list of KeyInfoProviders to use in this resolverlocalCredentialResolver - resolver of local credentials@Nonnull public CredentialResolver getLocalCredentialResolver()
protected void postProcess(@Nonnull
KeyInfoResolutionContext kiContext,
@Nullable
net.shibboleth.utilities.java.support.resolver.CriteriaSet criteriaSet,
@Nonnull
java.util.List<Credential> credentials)
throws net.shibboleth.utilities.java.support.resolver.ResolverException
postProcess in class BasicProviderKeyInfoCredentialResolverkiContext - KeyInfo resolution contextcriteriaSet - the credential criteria used to resolve credentialscredentials - the list which will store the resolved credentialsnet.shibboleth.utilities.java.support.resolver.ResolverException - thrown if there is an error during processingprotected boolean isLocalCredential(@Nonnull
Credential credential)
credential - the credential to evaluate@Nonnull protected java.util.Collection<? extends Credential> resolveByKeyName(@Nonnull java.lang.String keyName) throws net.shibboleth.utilities.java.support.resolver.ResolverException
keyName - the key name criterianet.shibboleth.utilities.java.support.resolver.ResolverException - thrown if there is a problem resolving credentials from the
local credential resolver@Nonnull protected java.util.Collection<? extends Credential> resolveByPublicKey(@Nonnull java.security.PublicKey publicKey) throws net.shibboleth.utilities.java.support.resolver.ResolverException
publicKey - the public key criterianet.shibboleth.utilities.java.support.resolver.ResolverException - thrown if there is a problem resolving credentials from the
local credential resolver