public class BasicSignatureSigningParametersResolver extends AbstractSecurityParametersResolver<SignatureSigningParameters> implements SignatureSigningParametersResolver
SignatureSigningParametersResolver
.
The following Criterion
inputs are supported:
SignatureSigningConfigurationCriterion
- requiredKeyInfoGenerationProfileCriterion
- optionalConstructor and Description |
---|
BasicSignatureSigningParametersResolver()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
credentialSupportsAlgorithm(Credential credential,
String algorithm)
Evaluate whether the specified credential is supported for use with the specified algorithm URI.
|
AlgorithmRegistry |
getAlgorithmRegistry()
Get the
AlgorithmRegistry instance used when resolving algorithm URIs. |
protected com.google.common.base.Predicate<String> |
getAlgorithmRuntimeSupportedPredicate()
Get a predicate which evaluates whether a cryptographic algorithm is supported
by the runtime environment.
|
protected List<String> |
getEffectiveSignatureAlgorithms(CriteriaSet criteria,
com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
Get the effective list of signature algorithm URIs to consider, including application of
whitelist/blacklist policy.
|
protected List<Credential> |
getEffectiveSigningCredentials(CriteriaSet criteria)
Get the effective list of signing credentials to consider.
|
protected com.google.common.base.Predicate<String> |
getWhitelistBlacklistPredicate(CriteriaSet criteria)
Get a predicate which implements the effective configured whitelist/blacklist policy.
|
protected void |
logResult(SignatureSigningParameters params)
Log the resolved parameters.
|
Iterable<SignatureSigningParameters> |
resolve(CriteriaSet criteria)
Process the specified criteria and return the resulting instances of the product type
which satisfy the criteria.
|
protected void |
resolveAndPopulateCredentialAndSignatureAlgorithm(SignatureSigningParameters params,
CriteriaSet criteria,
com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
Resolve and populate the signing credential and signature method algorithm URI on the
supplied parameters instance.
|
protected String |
resolveCanonicalizationAlgorithm(CriteriaSet criteria)
Resolve and return the canonicalization algorithm URI to use.
|
protected Integer |
resolveHMACOutputLength(CriteriaSet criteria,
Credential signingCredential,
String algorithmURI)
Resolve and return the effective HMAC output length to use, if applicable to the specified signing credential
and signature method algorithm URI.
|
protected KeyInfoGenerator |
resolveKeyInfoGenerator(CriteriaSet criteria,
Credential signingCredential)
Resolve and return the
KeyInfoGenerator instance to use with the specified credential. |
protected String |
resolveReferenceDigestMethod(CriteriaSet criteria,
com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
Resolve and return the digest method algorithm URI to use, including application of whitelist/blacklist policy.
|
SignatureSigningParameters |
resolveSingle(CriteriaSet criteria)
Process the specified criteria and return a single instance of the product type
which satisfies the criteria.
|
void |
setAlgorithmRegistry(AlgorithmRegistry registry)
Set the
AlgorithmRegistry instance used when resolving algorithm URIs. |
protected boolean |
validate(SignatureSigningParameters params)
Validate that the
SignatureSigningParameters instance has all the required properties populated. |
lookupKeyInfoGenerator, resolveAndPopulateWhiteAndBlacklists, resolveEffectiveBlacklist, resolveEffectiveWhitelist, resolveWhitelistBlacklistPrecedence, resolveWhitelistBlacklistPredicate
public BasicSignatureSigningParametersResolver()
public AlgorithmRegistry getAlgorithmRegistry()
AlgorithmRegistry
instance used when resolving algorithm URIs. Defaults to
the registry obtained via AlgorithmSupport.getGlobalAlgorithmRegistry()
.public void setAlgorithmRegistry(@Nonnull AlgorithmRegistry registry)
AlgorithmRegistry
instance used when resolving algorithm URIs. Defaults to
the registry obtained via AlgorithmSupport.getGlobalAlgorithmRegistry()
.registry
- the new algorithm registry instance@Nonnull public Iterable<SignatureSigningParameters> resolve(@Nonnull CriteriaSet criteria) throws ResolverException
resolve
in interface Resolver<SignatureSigningParameters,CriteriaSet>
criteria
- the criteria to evaluate or processResolverException
- thrown if there is an error processing the specified criteria@Nullable public SignatureSigningParameters resolveSingle(@Nonnull CriteriaSet criteria) throws ResolverException
resolveSingle
in interface Resolver<SignatureSigningParameters,CriteriaSet>
criteria
- the criteria to evaluate or processResolverException
- thrown if there is an error processing the specified criteriaprotected void logResult(@Nonnull SignatureSigningParameters params)
params
- the resolved paramprotected boolean validate(@Nonnull SignatureSigningParameters params)
SignatureSigningParameters
instance has all the required properties populated.params
- the parameters instance to evaluate@Nonnull protected com.google.common.base.Predicate<String> getWhitelistBlacklistPredicate(@Nonnull CriteriaSet criteria)
criteria
- the input criteria being evaluatedprotected void resolveAndPopulateCredentialAndSignatureAlgorithm(@Nonnull SignatureSigningParameters params, @Nonnull CriteriaSet criteria, com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
params
- the parameters instance being populatedcriteria
- the input criteria being evaluatedwhitelistBlacklistPredicate
- the whitelist/blacklist predicate with which to evaluate the
candidate signing method algorithm URIs@Nonnull protected com.google.common.base.Predicate<String> getAlgorithmRuntimeSupportedPredicate()
protected boolean credentialSupportsAlgorithm(@Nonnull Credential credential, @Nonnull @NotEmpty String algorithm)
credential
- the credential to evaluatealgorithm
- the algorithm URI to evaluate@Nonnull protected List<Credential> getEffectiveSigningCredentials(@Nonnull CriteriaSet criteria)
criteria
- the input criteria being evaluated@Nonnull protected List<String> getEffectiveSignatureAlgorithms(@Nonnull CriteriaSet criteria, @Nonnull com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
criteria
- the input criteria being evaluatedwhitelistBlacklistPredicate
- the whitelist/blacklist predicate to use@Nullable protected String resolveReferenceDigestMethod(@Nonnull CriteriaSet criteria, @Nonnull com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
criteria
- the input criteria being evaluatedwhitelistBlacklistPredicate
- the whitelist/blacklist predicate to use@Nullable protected String resolveCanonicalizationAlgorithm(@Nonnull CriteriaSet criteria)
criteria
- the input criteria being evaluated@Nullable protected KeyInfoGenerator resolveKeyInfoGenerator(@Nonnull CriteriaSet criteria, @Nonnull Credential signingCredential)
KeyInfoGenerator
instance to use with the specified credential.criteria
- the input criteria being evaluatedsigningCredential
- the credential being evaluated@Nullable protected Integer resolveHMACOutputLength(@Nonnull CriteriaSet criteria, @Nonnull Credential signingCredential, @Nonnull @NotEmpty String algorithmURI)
criteria
- the input criteria being evaluatedsigningCredential
- the signing credential being evaluatedalgorithmURI
- the signature method algorithm URI being evaluatedCopyright © 2016 JBoss by Red Hat. All rights reserved.