Class ExplicitKeySignatureTrustEngine
java.lang.Object
org.opensaml.xmlsec.signature.support.impl.BaseSignatureTrustEngine<Iterable<Credential>>
org.opensaml.xmlsec.signature.support.impl.ExplicitKeySignatureTrustEngine
- All Implemented Interfaces:
TrustedCredentialTrustEngine<Signature>,TrustEngine<Signature>,SignatureTrustEngine
public class ExplicitKeySignatureTrustEngine
extends BaseSignatureTrustEngine<Iterable<Credential>>
implements TrustedCredentialTrustEngine<Signature>
An implementation of
SignatureTrustEngine which evaluates the validity
and trustworthiness of XML and raw signatures.
Processing is first 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 resolveable valid (and trusted) signing
key, then all trusted credentials obtained by the trusted credential resolver will be used to attempt to validate the
signature.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CredentialResolverResolver used for resolving trusted credentials.private final ExplicitKeyTrustEvaluatorThe external explicit key trust engine to use as a basis for trust in this implementation.private final org.slf4j.LoggerClass logger. -
Constructor Summary
ConstructorsConstructorDescriptionExplicitKeySignatureTrustEngine(CredentialResolver resolver, KeyInfoCredentialResolver keyInfoResolver) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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, Iterable<Credential> trustedCredentials) Evaluate the untrusted KeyInfo-derived credential with respect to the specified trusted 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. -
credentialResolver
Resolver used for resolving trusted credentials. -
keyTrust
The external explicit key trust engine to use as a basis for trust in this implementation.
-
-
Constructor Details
-
ExplicitKeySignatureTrustEngine
public ExplicitKeySignatureTrustEngine(@Nonnull @ParameterName(name="resolver") CredentialResolver resolver, @Nonnull @ParameterName(name="keyInfoResolver") KeyInfoCredentialResolver keyInfoResolver) 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.
-
-
Method Details
-
getCredentialResolver
- Specified by:
getCredentialResolverin interfaceTrustedCredentialTrustEngine<Signature>
-
evaluateTrust
protected boolean evaluateTrust(@Nonnull Credential untrustedCredential, @Nullable Iterable<Credential> trustedCredentials) throws SecurityException Evaluate the untrusted KeyInfo-derived credential with respect to the specified trusted information.- Specified by:
evaluateTrustin classBaseSignatureTrustEngine<Iterable<Credential>>- Parameters:
untrustedCredential- the untrusted credential being evaluatedtrustedCredentials- the information which serves as the basis for trust evaluation- Returns:
- true if the trust can be established for the untrusted credential, otherwise false
- Throws:
SecurityException- if an error occurs during trust processing
-