Package org.apache.wss4j.dom.validate
Class SignatureTrustValidator
java.lang.Object
org.apache.wss4j.dom.validate.SignatureTrustValidator
- All Implemented Interfaces:
Validator
- Direct Known Subclasses:
SamlAssertionValidator
This class verifies trust in a credential used to verify a signature, which is extracted
from the Credential passed to the validate method.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.wss4j.common.crypto.CryptogetCrypto(RequestData data) validate(Credential credential, RequestData data) Validate the credential argument.protected voidvalidateCertificates(X509Certificate[] certificates) Validate the certificates by checking the validity of each certprotected voidvalidatePublicKey(PublicKey publicKey, org.apache.wss4j.common.crypto.Crypto crypto) Validate a public keyprotected voidverifyTrustInCerts(X509Certificate[] certificates, org.apache.wss4j.common.crypto.Crypto crypto, RequestData data, boolean enableRevocation) Evaluate whether the given certificate chain should be trusted.
-
Constructor Details
-
SignatureTrustValidator
public SignatureTrustValidator()
-
-
Method Details
-
validate
public Credential validate(Credential credential, RequestData data) throws org.apache.wss4j.common.ext.WSSecurityException Validate the credential argument. It must contain a non-null X509Certificate chain or a PublicKey. A Crypto implementation is also required to be set. This implementation first attempts to verify trust on the certificate (chain). If this is not successful, then it will attempt to verify trust on the Public Key. -
getCrypto
-
validateCertificates
protected void validateCertificates(X509Certificate[] certificates) throws org.apache.wss4j.common.ext.WSSecurityException Validate the certificates by checking the validity of each cert- Throws:
org.apache.wss4j.common.ext.WSSecurityException
-
verifyTrustInCerts
protected void verifyTrustInCerts(X509Certificate[] certificates, org.apache.wss4j.common.crypto.Crypto crypto, RequestData data, boolean enableRevocation) throws org.apache.wss4j.common.ext.WSSecurityException Evaluate whether the given certificate chain should be trusted.- Parameters:
certificates- the certificate chain that should be validated against the keystorecrypto- A Crypto instancedata- A RequestData instanceenableRevocation- Whether revocation is enabled or not- Throws:
org.apache.wss4j.common.ext.WSSecurityException- if the certificate chain is not trusted
-
validatePublicKey
protected void validatePublicKey(PublicKey publicKey, org.apache.wss4j.common.crypto.Crypto crypto) throws org.apache.wss4j.common.ext.WSSecurityException Validate a public key- Throws:
org.apache.wss4j.common.ext.WSSecurityException
-