public final class CertValidator extends Object
| Constructor and Description |
|---|
CertValidator(TrustStore trustStore) |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkValidity(X509Certificate cert,
Date validationDate) |
static CertValidatorResult.OCSPResult |
getOCSPResult(LinkedHashMap<BigInteger,X509Certificate> certificateMap,
String responderURL)
Requests the OCSP responder the status of the given certificates.
|
static X509Certificate |
parse(byte[] data)
Generates X509Certificate from the given data.
|
static X509Certificate |
parseWithBouncyCastleProvider(byte[] data) |
void |
setTargetCertCrlEnabled(boolean targetCertCrlEnabled) |
void |
setTrustedListAsPrimarySource(boolean trustedListAsPrimarySource) |
CertValidatorResult |
validateCertificatePath(CertPath certPath,
Date validationDate,
boolean crlEnabled,
boolean ocspEnabled) |
CertValidatorResult |
validateCertificatePath(CertPath certPath,
Date validationDate,
boolean crlEnabled,
OCSPClient ocspClient) |
CertValidatorResult |
validateCertificatePath(CertPath certPath,
Date validationDate,
List<byte[]> crlData,
List<byte[]> ocspData)
OFFLINE validation.
|
static CertValidatorResult |
validateCertPath(CertPath certPath,
Date validationDate,
boolean crlEnabled,
boolean ocspEnabled)
Deprecated.
as of 2016-01-26 use
validateCertificatePath(CertPath, Date, boolean, boolean) |
static CertValidatorResult |
validateCertPath(CertPath certPath,
Date validationDate,
boolean crlEnabled,
OCSPClient ocspClient)
Deprecated.
as of 2016-01-26 use
validateCertificatePath(CertPath, Date, boolean, OCSPClient) |
static CertValidatorResult |
validateCertPath(CertPath certPath,
Date validationDate,
Collection<X509CRL> crls)
Deprecated.
as of 2016-01-26 use
validateCertificatePath(CertPath, Date, List, List) |
CertValidatorResult.CRLResult |
validateCertStatusUsingCRL(X509Certificate cert,
Date validationDate) |
static CertValidatorResult.OCSPResult |
validateCertStatusUsingOCSP(BigInteger serialNumber,
String issuerSubject,
String issuerSubjectKeyIdentifier,
Date validationDate,
String responderURL)
Validates certificate status using OCSP responder service.
|
static CertValidatorResult.OCSPResult |
validateCertStatusUsingOCSP(X509Certificate cert,
Date validationDate)
Validates certificate status using OCSP responder service.
|
static CertValidatorResult.OCSPResult |
validateCertStatusUsingOCSP(X509Certificate cert,
Date validationDate,
boolean useResultCache)
Validates certificate status using OCSP responder service.
|
static CertValidatorResult.OCSPResult |
validateCertStatusUsingOCSP(X509Certificate cert,
Date validationDate,
OCSPClient ocspClient)
Validates certificate status using OCSP responder service.
|
public CertValidator(TrustStore trustStore)
public void setTargetCertCrlEnabled(boolean targetCertCrlEnabled)
public void setTrustedListAsPrimarySource(boolean trustedListAsPrimarySource)
@Deprecated public static CertValidatorResult validateCertPath(CertPath certPath, Date validationDate, Collection<X509CRL> crls) throws CertValidatorException
validateCertificatePath(CertPath, Date, List, List)This method uses the following EDOC configuration properties:
certPath - the certification path.validationDate - validation date.crls - revocation dataCertValidatorException - if certification path cannot be validated.@Deprecated public static CertValidatorResult validateCertPath(CertPath certPath, Date validationDate, boolean crlEnabled, boolean ocspEnabled) throws CertValidatorException
validateCertificatePath(CertPath, Date, boolean, boolean)This method uses the following EDOC configuration properties:
certPath - the certification path.validationDate - validation date.crlEnabled - true if CRL checking is enabled.ocspEnabled - true if OCSP checking is enabled.CertValidatorException - if certification path cannot be validated.public CertValidatorResult validateCertificatePath(CertPath certPath, Date validationDate, boolean crlEnabled, boolean ocspEnabled) throws CertValidatorException
CertValidatorException@Deprecated public static CertValidatorResult validateCertPath(CertPath certPath, Date validationDate, boolean crlEnabled, OCSPClient ocspClient) throws CertValidatorException
validateCertificatePath(CertPath, Date, boolean, OCSPClient)certPath - the certification path.validationDate - validation date.crlEnabled - true if CRL checking is enabled.ocspClient - OCSPClient used to obtain OCSP responses.CertValidatorException - if certification path cannot be validated.public CertValidatorResult validateCertificatePath(CertPath certPath, Date validationDate, boolean crlEnabled, OCSPClient ocspClient) throws CertValidatorException
CertValidatorExceptionpublic CertValidatorResult validateCertificatePath(CertPath certPath, Date validationDate, List<byte[]> crlData, List<byte[]> ocspData) throws CertValidatorException
certPath - the certification path.validationDate - validation date.crlData - CRL data, or null if CRL disabled.ocspData - OCSP data, or null if OCSP disabled.CertValidatorException - if certification path cannot be validated.public static CertValidatorResult.OCSPResult validateCertStatusUsingOCSP(BigInteger serialNumber, String issuerSubject, String issuerSubjectKeyIdentifier, Date validationDate, String responderURL) throws CertValidatorException
serialNumber - serial number of the certificate.issuerSubject - subject name of the certificate issuer.
The subject name must be specified using the grammar defined in RFC 1779 or RFC 2253 (either format is acceptable),
e.g. "CN=VAS Latvijas Pasts SI(CA1), OU=Sertifikacijas pakalpojumi, O=VAS Latvijas Pasts - Vien.reg.Nr.40003052790, C=LV".
issuerSubjectKeyIdentifier - subject key identifier of the certificate issuer.
The subject key identifier must be specified as hexadecimal string of the
DER encoded value (excluding tag and length) of the subject public key field in the certificate,
e.g. "2c3e036e9239e283072795b10feffe633a6a9017".
validationDate - validation date.responderURL - a URL that identifies the location of the OCSP responder.CertValidatorException - if certification path cannot be validated.public static CertValidatorResult.OCSPResult validateCertStatusUsingOCSP(X509Certificate cert, Date validationDate) throws CertValidatorException
cert - the certificate.validationDate - validation date.CertValidatorException - if certification path cannot be validated.public static CertValidatorResult.OCSPResult validateCertStatusUsingOCSP(X509Certificate cert, Date validationDate, boolean useResultCache) throws CertValidatorException
cert - the certificate.validationDate - validation date.useResultCache - true if to use the OCSP result cache.CertValidatorException - if certification path cannot be validated.public static CertValidatorResult.OCSPResult validateCertStatusUsingOCSP(X509Certificate cert, Date validationDate, OCSPClient ocspClient) throws CertValidatorException
cert - the certificate.validationDate - validation date.ocspClient - OCSPClient used to obtain OCSP responses.CertValidatorException - if certification path cannot be validated.public static CertValidatorResult.OCSPResult getOCSPResult(LinkedHashMap<BigInteger,X509Certificate> certificateMap, String responderURL) throws CertValidatorException
certificateMap - map containing certificate identifiers.responderURL - a URL that identifies the location of the OCSP responder.CertValidatorException - if OCSP request cannot be processed.public CertValidatorResult.CRLResult validateCertStatusUsingCRL(X509Certificate cert, Date validationDate) throws CertValidatorException
CertValidatorExceptionpublic static X509Certificate parse(byte[] data) throws CertificateException
data - the certificate data.CertificateException - if certificate can not be parsed.public static X509Certificate parseWithBouncyCastleProvider(byte[] data) throws CertificateException
CertificateExceptionpublic static void checkValidity(X509Certificate cert, Date validationDate) throws CertValidatorException
CertValidatorException