Package org.opensaml.xmlsec.signature.support

# Class SignatureValidator

java.lang.Object
org.opensaml.xmlsec.signature.support.SignatureValidator

public final class SignatureValidator extends Object
A service class that cryptographically validates an XML Signature `Signature` using a candidate validation `Credential`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private static final org.slf4j.Logger`
`LOG`
Logger.
`private static SignatureValidationProvider`
`validatorInstance`
The cached signature validation provider instance to use.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`SignatureValidator()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`private static SignatureValidationProvider`
`getSignatureValidationProvider()`
Obtain the `SignatureValidationProvider` instance to be used.
`static void`
`validate(Signature signature, Credential validationCredential)`
Validate the given XML Signature using the given candidate validation Credential.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### LOG

@Nonnull private static final org.slf4j.Logger LOG
Logger.

### validatorInstance

@Nullable private static SignatureValidationProvider validatorInstance
The cached signature validation provider instance to use.

## Constructor Details

### SignatureValidator

protected SignatureValidator()
Constructor.

## Method Details

### validate

public static void validate(@Nonnull Signature signature, @Nonnull Credential validationCredential) throws SignatureException
Validate the given XML Signature using the given candidate validation Credential.

Parameters:
  `signature` - the XMLSignature to validate
  `validationCredential` - the candidate validation Credential
Throws:
  `SignatureException` - if the signature does not validate using the candiate Credential, or if there is otherwise an error during the validation operation

### getSignatureValidationProvider

@Nonnull private static SignatureValidationProvider getSignatureValidationProvider() throws SignatureException
Obtain the `SignatureValidationProvider` instance to be used.

Returns:
  the SignatureValidationProvider
Throws:
  `SignatureException` - if a SignatureValidationProvider could not be loaded