public class SAMLMetadataEncryptionParametersResolver extends BasicEncryptionParametersResolver
BasicEncryptionParametersResolver
which resolves
credentials and algorithm preferences against SAML metadata via a MetadataCredentialResolver
.
In addition to the Criterion
inputs documented in
BasicEncryptionParametersResolver
, the inputs and associated modes of operation documented for
MetadataCredentialResolver
are also supported and required.
The CriteriaSet
instance passed to the configured metadata credential resolver will be a copy
of the input criteria set, with the addition of a UsageCriterion
containing the value
UsageType.ENCRYPTION
, which will replace any existing usage criterion instance.
Constructor and Description |
---|
SAMLMetadataEncryptionParametersResolver(MetadataCredentialResolver resolver)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
credentialSupportsEncryptionMethod(Credential credential,
EncryptionMethod encryptionMethod)
Evaluate whether the specified credential is supported for use with the specified
EncryptionMethod . |
protected boolean |
evaluateEncryptionMethodChildren(EncryptionMethod encryptionMethod,
CriteriaSet criteria,
com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
Evaluate the child elements of an EncryptionMethod for acceptability based on for example
whitelist/blacklist policy and algorithm runtime support.
|
protected boolean |
evaluateRSAOAEPChildren(EncryptionMethod encryptionMethod,
CriteriaSet criteria,
com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
Evaluate the child elements of an RSA OAEP EncryptionMethod for acceptability based on for example
whitelist/blacklist policy and algorithm runtime support.
|
protected MetadataCredentialResolver |
getMetadataCredentialResolver()
Get the metadata credential resolver instance to use to resolve encryption credentials.
|
boolean |
isMergeMetadataRSAOAEPParametersWithConfig()
Determine whether the resolver should attempt to merge RSAOAEPParameters values resolved
from metadata with additional parameters from supplied instances of
EncryptionConfiguration . |
protected void |
populateRSAOAEPParamsFromEncryptionMethod(RSAOAEPParameters params,
EncryptionMethod encryptionMethod,
com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
Extract
DigestMethod , MGF and OAEPparams data present on the supplied
instance of EncryptionMethod and populate it on the supplied instance of of
RSAOAEPParameters . |
protected void |
resolveAndPopulateCredentialsAndAlgorithms(EncryptionParameters params,
CriteriaSet criteria,
com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
Resolve and populate the data encryption and key transport credentials and algorithm URIs.
|
protected void |
resolveAndPopulateRSAOAEPParams(EncryptionParameters params,
CriteriaSet criteria,
com.google.common.base.Predicate<String> whitelistBlacklistPredicate,
EncryptionMethod encryptionMethod)
Resolve and populate an instance of
RSAOAEPParameters , if appropriate for the selected
key transport encryption algorithm. |
protected Pair<String,EncryptionMethod> |
resolveDataEncryptionAlgorithm(CriteriaSet criteria,
com.google.common.base.Predicate<String> whitelistBlacklistPredicate,
SAMLMDCredentialContext metadataCredContext)
Determine the data encryption algorithm URI to use, also returning the associated
EncryptionMethod from metadata if relevant. |
protected Pair<String,EncryptionMethod> |
resolveKeyTransportAlgorithm(Credential keyTransportCredential,
CriteriaSet criteria,
com.google.common.base.Predicate<String> whitelistBlacklistPredicate,
String dataEncryptionAlgorithm,
SAMLMDCredentialContext metadataCredContext)
Determine the key transport algorithm URI to use with the specified credential, also returning the associated
EncryptionMethod from metadata if relevant. |
void |
setMergeMetadataRSAOAEPParametersWithConfig(boolean flag)
Set whether the resolver should attempt to merge RSAOAEPParameters values resolved
from metadata with additional parameters from supplied instances of
EncryptionConfiguration . |
credentialSupportsAlgorithm, generateDataEncryptionCredential, getAlgorithmRegistry, getAlgorithmRuntimeSupportedPredicate, getEffectiveDataEncryptionAlgorithms, getEffectiveDataEncryptionCredentials, getEffectiveKeyTransportAlgorithms, getEffectiveKeyTransportCredentials, getWhitelistBlacklistPredicate, isAutoGenerateDataEncryptionCredential, isDataEncryptionAlgorithm, isKeyTransportAlgorithm, logResult, populateRSAOAEPParams, processDataEncryptionCredentialAutoGeneration, resolve, resolveAndPopulateRSAOAEPParams, resolveDataEncryptionAlgorithm, resolveDataEncryptionAlgorithm, resolveDataKeyInfoGenerator, resolveKeyTransportAlgorithm, resolveKeyTransportAlgorithm, resolveKeyTransportAlgorithmPredicate, resolveKeyTransportKeyInfoGenerator, resolveSingle, setAlgorithmRegistry, setAutoGenerateDataEncryptionCredential, validate
lookupKeyInfoGenerator, resolveAndPopulateWhiteAndBlacklists, resolveEffectiveBlacklist, resolveEffectiveWhitelist, resolveWhitelistBlacklistPrecedence, resolveWhitelistBlacklistPredicate
public SAMLMetadataEncryptionParametersResolver(@Nonnull MetadataCredentialResolver resolver)
resolver
- the metadata credential resolver instance to use to resolve encryption credentialspublic boolean isMergeMetadataRSAOAEPParametersWithConfig()
EncryptionConfiguration
.
Defaults to: false
public void setMergeMetadataRSAOAEPParametersWithConfig(boolean flag)
EncryptionConfiguration
.
Defaults to: false
flag
- true if should merge metadata parameters with configuration, false otherwise@Nonnull protected MetadataCredentialResolver getMetadataCredentialResolver()
protected void resolveAndPopulateCredentialsAndAlgorithms(@Nonnull EncryptionParameters params, @Nonnull CriteriaSet criteria, @Nonnull com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
resolveAndPopulateCredentialsAndAlgorithms
in class BasicEncryptionParametersResolver
params
- the params instance being populatedcriteria
- the input criteria being evaluatedwhitelistBlacklistPredicate
- the whitelist/blacklist predicate with which to evaluate the
candidate data encryption and key transport algorithm URIsprotected void resolveAndPopulateRSAOAEPParams(@Nonnull EncryptionParameters params, @Nonnull CriteriaSet criteria, @Nonnull com.google.common.base.Predicate<String> whitelistBlacklistPredicate, @Nullable EncryptionMethod encryptionMethod)
RSAOAEPParameters
, if appropriate for the selected
key transport encryption algorithm.
This method itself resolves the parameters data from the metadata EncryptionMethod
. If
this results in a non-complete RSAOAEPParameters instance and if
isMergeMetadataRSAOAEPParametersWithConfig()
evaluates true,
then the resolver will delegate to the local config resolution process via the superclass
to attempt to resolve and merge any null parameter values.
(see BasicEncryptionParametersResolver.resolveAndPopulateRSAOAEPParams(EncryptionParameters, CriteriaSet, Predicate)
).
params
- the current encryption parameters instance being resolvedcriteria
- the criteria instance being evaluatedwhitelistBlacklistPredicate
- the whitelist/blacklist predicate with which to evaluate the
candidate data encryption and key transport algorithm URIsencryptionMethod
- the method encryption method that was resolved along with the key transport
encryption algorithm URI, if any. May be null.protected void populateRSAOAEPParamsFromEncryptionMethod(@Nonnull RSAOAEPParameters params, @Nonnull EncryptionMethod encryptionMethod, @Nonnull com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
DigestMethod
, MGF
and OAEPparams
data present on the supplied
instance of EncryptionMethod
and populate it on the supplied instance of of
RSAOAEPParameters
.
Whitelist/blacklist evaluation is applied to the digest method and MGF algorithm URIs.
params
- the existing RSAOAEPParameters instance being populatedencryptionMethod
- the method encryption method that was resolved along with the key transport
encryption algorithm URI, if any. May be null.whitelistBlacklistPredicate
- the whitelist/blacklist predicate with which to evaluate the
candidate data encryption and key transport algorithm URIs@Nonnull protected Pair<String,EncryptionMethod> resolveKeyTransportAlgorithm(@Nonnull Credential keyTransportCredential, @Nonnull CriteriaSet criteria, @Nonnull com.google.common.base.Predicate<String> whitelistBlacklistPredicate, @Nullable String dataEncryptionAlgorithm, @Nullable SAMLMDCredentialContext metadataCredContext)
EncryptionMethod
from metadata if relevant.
Any algorithms specified in metadata via the passed SAMLMDCredentialContext
are considered first,
followed by locally configured algorithms.
keyTransportCredential
- the key transport credential to evaluatecriteria
- the criteria instance being evaluatedwhitelistBlacklistPredicate
- the whitelist/blacklist predicate with which to evaluate the
candidate data encryption and key transport algorithm URIsdataEncryptionAlgorithm
- the optional data encryption algorithm URI to considermetadataCredContext
- the credential context extracted from metadata@Nonnull protected Pair<String,EncryptionMethod> resolveDataEncryptionAlgorithm(@Nonnull CriteriaSet criteria, @Nonnull com.google.common.base.Predicate<String> whitelistBlacklistPredicate, @Nullable SAMLMDCredentialContext metadataCredContext)
EncryptionMethod
from metadata if relevant.
Any algorithms specified in metadata via the passed SAMLMDCredentialContext
are considered first,
followed by locally configured algorithms.
criteria
- the criteria instance being evaluatedwhitelistBlacklistPredicate
- the whitelist/blacklist predicate with which to evaluate the
candidate data encryption and key transport algorithm URIsmetadataCredContext
- the credential context extracted from metadataprotected boolean evaluateEncryptionMethodChildren(@Nonnull EncryptionMethod encryptionMethod, @Nonnull CriteriaSet criteria, @Nonnull com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
encryptionMethod
- the EncryptionMethod being evaluatedcriteria
- the criteria instance being evaluatedwhitelistBlacklistPredicate
- the whitelist/blacklist predicate with which to evaluate the
candidate data encryption and key transport algorithm URIsprotected boolean evaluateRSAOAEPChildren(@Nonnull EncryptionMethod encryptionMethod, @Nonnull CriteriaSet criteria, @Nonnull com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
encryptionMethod
- the EncryptionMethod being evaluatedcriteria
- the criteria instance being evaluatedwhitelistBlacklistPredicate
- the whitelist/blacklist predicate with which to evaluate the
candidate data encryption and key transport algorithm URIsprotected boolean credentialSupportsEncryptionMethod(@Nonnull Credential credential, @Nonnull @NotEmpty EncryptionMethod encryptionMethod)
EncryptionMethod
.credential
- the credential to evaluateencryptionMethod
- the encryption method to evaluateCopyright © 2016 JBoss by Red Hat. All rights reserved.