public abstract class ATSLValidator extends java.lang.Object implements ITSLValidator
Abstract class that represents a TSL validator with the principal functions regardless it implementation.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TSP_SERVICE_NAME_FOR_DIST_POINT
Constant attribute that represents a token for a TSP Service Name when the validation has been executed
using the Distribution Point of the certificate to validate.
|
| Constructor and Description |
|---|
ATSLValidator()
Constructor method for the class ATSLValidator.java.
|
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
checkIfTSPServiceStatusIsOK(java.lang.String serviceStatus)
Checks if the input service status URI defines an OK status.
|
abstract boolean |
checkIfTSPServiceTypeIsCAPKC(java.lang.String tspServiceType)
Checks if the input TSP Service Type is CA PKC.
|
abstract boolean |
checkIfTSPServiceTypeIsCAQC(java.lang.String tspServiceType)
Checks if the input TSP Service Type is CA QC.
|
abstract boolean |
checkIfTSPServiceTypeIsCRLCompatible(ServiceHistoryInstance shi,
boolean isCertQualified)
Checks if the service type is a CRL compatible type.
|
abstract boolean |
checkIfTSPServiceTypeIsOCSPCompatible(ServiceHistoryInstance shi,
boolean isCertQualified)
Checks if the service type is a OCSP compatible type.
|
java.security.cert.X509Certificate |
getCertificateFromHTTPURI(java.net.URI uri,
int readTimeout,
int connectionTimeout)
Method that obtains the certificate from a URI passed by parameter.
|
ITSLValidatorResult |
validateCertificateWithTSL(java.security.cert.X509Certificate cert,
boolean isCACert,
boolean isTsaCertificate,
java.util.Date validationDate,
boolean checkStatusRevocation)
Validate the status of the input certificate with the information of the TSL.
|
public static final java.lang.String TSP_SERVICE_NAME_FOR_DIST_POINT
public ATSLValidator()
public ITSLValidatorResult validateCertificateWithTSL(java.security.cert.X509Certificate cert, boolean isCACert, boolean isTsaCertificate, java.util.Date validationDate, boolean checkStatusRevocation) throws TSLArgumentException, TSLValidationException
validateCertificateWithTSL in interface ITSLValidatorcert - Certificate X509 v3 to validate.isCACert - Flag that indicates if the input certificate has the Basic Constraints with the CA flag activated
(true) or not (false).isTsaCertificate - Flag that indicates if the input certificate has the id-kp-timestamping key purpose
(true) or not (false).validationDate - Validation date to check the certificate status revocation.checkStatusRevocation - Flag that indicates if only try to detect the input certificate (false)
or also checks the revocation status of this (true).TSLArgumentException - In case of the input certificate was null.TSLValidationException - In case of some error validating the certificate with the TSL.ITSLValidator.validateCertificateWithTSL(X509Certificate, boolean, boolean, Date, boolean)public abstract boolean checkIfTSPServiceStatusIsOK(java.lang.String serviceStatus)
serviceStatus - Service Status URI string to check.true if represents an OK status, otherwise false.public abstract boolean checkIfTSPServiceTypeIsCAQC(java.lang.String tspServiceType)
tspServiceType - TSP Service type URI to check.true if it represents a CA QC TSP Service, otherwise false.public abstract boolean checkIfTSPServiceTypeIsCAPKC(java.lang.String tspServiceType)
tspServiceType - TSP Service type URI to check.true if it represents a CA PKC TSP Service, otherwise false.public abstract boolean checkIfTSPServiceTypeIsCRLCompatible(ServiceHistoryInstance shi, boolean isCertQualified)
shi - TSP Service History Information to analyze.isCertQualified - Flag that indicates if the certificate is qualified (true) or not (false).true if the Service type is CRL compatible with the certificate to validate. otherwise false.public abstract boolean checkIfTSPServiceTypeIsOCSPCompatible(ServiceHistoryInstance shi, boolean isCertQualified)
shi - TSP Service History Information to analyze.isCertQualified - Flag that indicates if the certificate is qualified (true) or not (false).true if the Service type is OCSP compatible with the certificate to validate. otherwise false.public java.security.cert.X509Certificate getCertificateFromHTTPURI(java.net.URI uri,
int readTimeout,
int connectionTimeout)
uri - target URI.readTimeout - Max millis to read the response.connectionTimeout - Max millis to connect to server.