Class PKIXSignatureTrustEngine
- All Implemented Interfaces:
TrustEngine<Signature>,PKIXTrustEngine<Signature>,SignatureTrustEngine
SignatureTrustEngine which evaluates the validity
and trustworthiness of XML and raw signatures.
Processing is performed as described in BaseSignatureTrustEngine. If based on this processing, it is
determined that the Signature's KeyInfo is not present or does not contain a valid (and trusted) signing key, then
trust engine validation fails. Since the PKIX engine is based on the assumption that trusted signing keys are not
known in advance, the signing key must be present in, or derivable from, the information in the Signature's KeyInfo
element.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final X509CredentialNameEvaluatorThe external credential name evaluator used to establish trusted name compliance.private final org.slf4j.LoggerClass logger.private final PKIXValidationInformationResolverResolver used for resolving trusted credentials.private final PKIXTrustEvaluatorThe external PKIX trust evaluator used to establish trust. -
Constructor Summary
ConstructorsConstructorDescriptionPKIXSignatureTrustEngine(PKIXValidationInformationResolver resolver, KeyInfoCredentialResolver keyInfoResolver) Constructor.PKIXSignatureTrustEngine(PKIXValidationInformationResolver resolver, KeyInfoCredentialResolver keyInfoResolver, PKIXTrustEvaluator pkixEvaluator, X509CredentialNameEvaluator nameEvaluator) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckNames(Set<String> trustedNames, X509Credential untrustedCredential) Evaluate the credential against the set of trusted names.protected booleandoValidate(byte[] signature, byte[] content, String algorithmURI, CriteriaSet trustBasisCriteria, Credential candidateCredential) Determines whether a raw signature over specified content is valid and signed by a trusted credential.protected booleandoValidate(Signature signature, CriteriaSet trustBasisCriteria) Validate the signature using the supplied trust criteria.protected booleanevaluateTrust(Credential untrustedCredential, Pair<Set<String>, Iterable<PKIXValidationInformation>> validationPair) Evaluate the untrusted KeyInfo-derived credential with respect to the specified trusted information.Get the PKIXTrustEvaluator instance used to evaluate trust.Get the X509CredentialNameEvaluator instance used to evaluate a credential against trusted names.protected Pair<Set<String>,Iterable<PKIXValidationInformation>> resolveValidationInfo(CriteriaSet trustBasisCriteria) Resolve and return a set of trusted validation information.Methods inherited from class org.opensaml.xmlsec.signature.support.impl.BaseSignatureTrustEngine
checkParams, checkParamsRaw, getKeyInfoResolver, validate, validate, validate, verifySignatureMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensaml.security.trust.TrustEngine
validate
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
pkixResolver
Resolver used for resolving trusted credentials. -
pkixTrustEvaluator
The external PKIX trust evaluator used to establish trust. -
credNameEvaluator
The external credential name evaluator used to establish trusted name compliance.
-
-
Constructor Details
-
PKIXSignatureTrustEngine
public PKIXSignatureTrustEngine(@Nonnull @ParameterName(name="resolver") PKIXValidationInformationResolver resolver, @Nonnull @ParameterName(name="keyInfoResolver") KeyInfoCredentialResolver keyInfoResolver) Constructor.The PKIX trust evaluator used defaults to
CertPathPKIXTrustEvaluator.The X.509 credential name evaluator used defaults to
BasicX509CredentialNameEvaluator.- Parameters:
resolver- credential resolver used to resolve trusted credentials.keyInfoResolver- KeyInfo credential resolver used to obtain the (advisory) signing credential from a Signature's KeyInfo element.
-
PKIXSignatureTrustEngine
public PKIXSignatureTrustEngine(@Nonnull @ParameterName(name="resolver") PKIXValidationInformationResolver resolver, @Nonnull @ParameterName(name="keyInfoResolver") KeyInfoCredentialResolver keyInfoResolver, @Nonnull @ParameterName(name="pkixEvaluator") PKIXTrustEvaluator pkixEvaluator, @Nullable @ParameterName(name="nameEvaluator") X509CredentialNameEvaluator nameEvaluator) Constructor.- Parameters:
resolver- credential resolver used to resolve trusted credentials.keyInfoResolver- KeyInfo credential resolver used to obtain the (advisory) signing credential from a Signature's KeyInfo element.pkixEvaluator- the PKIX trust evaluator to usenameEvaluator- the X.509 credential name evaluator to use (may be null)
-
-
Method Details
-
getPKIXTrustEvaluator
Get the PKIXTrustEvaluator instance used to evaluate trust.The parameters of this evaluator may be modified to adjust trust evaluation processing.
- Returns:
- the PKIX trust evaluator instance that will be used
-
getX509CredentialNameEvaluator
Get the X509CredentialNameEvaluator instance used to evaluate a credential against trusted names.The parameters of this evaluator may be modified to adjust trust evaluation processing.
- Returns:
- the PKIX trust evaluator instance that will be used
-
getPKIXResolver
- Specified by:
getPKIXResolverin interfacePKIXTrustEngine<Signature>
-
checkNames
protected boolean checkNames(@Nullable Set<String> trustedNames, @Nonnull X509Credential untrustedCredential) throws SecurityException Evaluate the credential against the set of trusted names.Evaluates to true if no instance of
X509CredentialNameEvaluatoris configured.- Parameters:
trustedNames- set of trusted namesuntrustedCredential- the credential being evaluated- Returns:
- true if evaluation is successful, false otherwise
- Throws:
SecurityException- thrown if there is an error evaluation the credential
-