com.rsa.swsj
Interface CertValidator

All Known Implementing Classes:
DefaultCertValidator

public interface CertValidator

This interface represents a Certificate Validator and describes methods available to the application for certificate validation functionality.

This interface is intended to be implemented by the application to provide SWS-J with assurances that a certificate contained in a message or a document is valid and acceptable for use.

Note: The only way to turn off certificate validation is to override the CertValidator class and force the validate() method to return true in all cases.


Field Summary

static byte

XML_ENC

Flag to indicate that the certificate must be validated for XML encryption

static byte

XML_SIG

Flag to indicate that the certificate must be validated for XML signature

 
Method Summary

 boolean

validate(java.security.cert.X509Certificate certToValidate, java.security.cert.X509Certificate[] extraCerts, int requiredUsage)

Validates a certificate, possibly against a supplied path or chain, and checks the key usage extensions of the certificate.

 

Field Detail

XML_SIG

public static final byte XML_SIG
Flag to indicate that the certificate must be validated for XML signature

See Also:
Constant Field Values

XML_ENC

public static final byte XML_ENC
Flag to indicate that the certificate must be validated for XML encryption

See Also:
Constant Field Values
Method Detail

validate

public boolean validate(java.security.cert.X509Certificate certToValidate,
                        java.security.cert.X509Certificate[] extraCerts,
                        int requiredUsage)
                 throws SWSJException
Validates a certificate, possibly against a supplied path or chain, and checks the key usage extensions of the certificate.

Parameters:
certToValidate - The certificate for which SWS-J is requesting validation.

extraCerts - An array of additonal and possibly unrelated certificates that were present in the parsed message or document. They are used to try to validate the certificate path. This array can be empty. The application must provide appropriate checks and assurances that the certificate is valid for use.

requiredUsage - An integer identifier for the required certificate usage; for example, encryption or signing. Valid values at present are XML_SIG and XML_ENC.

Returns:
true if the certificate was validated; otherwise, false.
Throws:
SWSJException - If any of the parameters are invalid.