Package org.opensaml.xmlsec.impl
Class BasicSignatureSigningParametersResolver
java.lang.Object
org.opensaml.xmlsec.impl.AbstractSecurityParametersResolver<SignatureSigningParameters>
org.opensaml.xmlsec.impl.BasicSignatureSigningParametersResolver
- All Implemented Interfaces:
Resolver<SignatureSigningParameters,,CriteriaSet> SignatureSigningParametersResolver
- Direct Known Subclasses:
SAMLMetadataSignatureSigningParametersResolver
public class BasicSignatureSigningParametersResolver
extends AbstractSecurityParametersResolver<SignatureSigningParameters>
implements SignatureSigningParametersResolver
Basic implementation of
SignatureSigningParametersResolver.
The following Criterion inputs are supported:
SignatureSigningConfigurationCriterion- requiredKeyInfoGenerationProfileCriterion- optional
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AlgorithmRegistryThe AlgorithmRegistry used when processing algorithm URIs.private org.slf4j.LoggerLogger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancredentialSupportsAlgorithm(Credential credential, String algorithm) Evaluate whether the specified credential is supported for use with the specified algorithm URI.Get theAlgorithmRegistryinstance used when resolving algorithm URIs.Get a predicate which evaluates whether a cryptographic algorithm is supported by the runtime environment.getEffectiveSignatureAlgorithms(CriteriaSet criteria, Predicate<String> includeExcludePredicate) Get the effective list of signature algorithm URIs to consider, including application of include/exclude policy.protected List<Credential>getEffectiveSigningCredentials(CriteriaSet criteria) Get the effective list of signing credentials to consider.getIncludeExcludePredicate(CriteriaSet criteria) Get a predicate which implements the effective configured include/exclude policy.protected voidlogResult(SignatureSigningParameters params) Log the resolved parameters.resolve(CriteriaSet criteria) protected voidresolveAndPopulateCredentialAndSignatureAlgorithm(SignatureSigningParameters params, CriteriaSet criteria, Predicate<String> includeExcludePredicate) Resolve and populate the signing credential and signature method algorithm URI on the supplied parameters instance.protected StringresolveCanonicalizationAlgorithm(CriteriaSet criteria) Resolve and return the canonicalization algorithm URI to use.protected IntegerresolveHMACOutputLength(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 KeyInfoGeneratorresolveKeyInfoGenerator(CriteriaSet criteria, Credential signingCredential) Resolve and return theKeyInfoGeneratorinstance to use with the specified credential.protected StringResolve and return the reference canonicalization algorithm URI to use.protected StringresolveReferenceDigestMethod(CriteriaSet criteria, Predicate<String> includeExcludePredicate) Resolve and return the digest method algorithm URI to use, including application of include/exclude policy.resolveSingle(CriteriaSet criteria) voidsetAlgorithmRegistry(AlgorithmRegistry registry) Set theAlgorithmRegistryinstance used when resolving algorithm URIs.protected booleanvalidate(SignatureSigningParameters params) Validate that theSignatureSigningParametersinstance has all the required properties populated.Methods inherited from class org.opensaml.xmlsec.impl.AbstractSecurityParametersResolver
lookupKeyInfoGenerator, resolveAndPopulateIncludesExcludes, resolveEffectiveExcludes, resolveEffectiveIncludes, resolveIncludeExcludePrecedence, resolveIncludeExcludePredicate
-
Field Details
-
log
@Nonnull private org.slf4j.Logger logLogger. -
algorithmRegistry
The AlgorithmRegistry used when processing algorithm URIs.
-
-
Constructor Details
-
BasicSignatureSigningParametersResolver
public BasicSignatureSigningParametersResolver()Constructor.
-
-
Method Details
-
getAlgorithmRegistry
Get theAlgorithmRegistryinstance used when resolving algorithm URIs. Defaults to the registry obtained viaAlgorithmSupport.getGlobalAlgorithmRegistry().- Returns:
- the algorithm registry instance
-
setAlgorithmRegistry
Set theAlgorithmRegistryinstance used when resolving algorithm URIs. Defaults to the registry obtained viaAlgorithmSupport.getGlobalAlgorithmRegistry().- Parameters:
registry- the new algorithm registry instance
-
logResult
Log the resolved parameters.- Parameters:
params- the resolved param
-
validate
Validate that theSignatureSigningParametersinstance has all the required properties populated.- Parameters:
params- the parameters instance to evaluate- Returns:
- true if parameters instance passes validation, false otherwise
-
getAlgorithmRuntimeSupportedPredicate
Get a predicate which evaluates whether a cryptographic algorithm is supported by the runtime environment.- Returns:
- the predicate
-
credentialSupportsAlgorithm
protected boolean credentialSupportsAlgorithm(@Nonnull Credential credential, @Nonnull @NotEmpty String algorithm) Evaluate whether the specified credential is supported for use with the specified algorithm URI.- Parameters:
credential- the credential to evaluatealgorithm- the algorithm URI to evaluate- Returns:
- true if credential may be used with the supplied algorithm URI, false otherwise
-