Package com.itextpdf.text.pdf.security
Class CertificateVerification
- java.lang.Object
-
- com.itextpdf.text.pdf.security.CertificateVerification
-
public class CertificateVerification extends java.lang.ObjectThis class consists of some methods that allow you to verify certificates.
-
-
Constructor Summary
Constructors Constructor Description CertificateVerification()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringverifyCertificate(java.security.cert.X509Certificate cert, java.util.Collection<java.security.cert.CRL> crls, java.util.Calendar calendar)Verifies a single certificate.static java.util.List<VerificationException>verifyCertificates(java.security.cert.Certificate[] certs, java.security.KeyStore keystore, java.util.Calendar calendar)Verifies a certificate chain against a KeyStore.static java.util.List<VerificationException>verifyCertificates(java.security.cert.Certificate[] certs, java.security.KeyStore keystore, java.util.Collection<java.security.cert.CRL> crls, java.util.Calendar calendar)Verifies a certificate chain against a KeyStore.static booleanverifyOcspCertificates(org.bouncycastle.cert.ocsp.BasicOCSPResp ocsp, java.security.KeyStore keystore, java.lang.String provider)Verifies an OCSP response against a KeyStore.static booleanverifyTimestampCertificates(org.bouncycastle.tsp.TimeStampToken ts, java.security.KeyStore keystore, java.lang.String provider)Verifies a time stamp against a KeyStore.
-
-
-
Method Detail
-
verifyCertificate
public static java.lang.String verifyCertificate(java.security.cert.X509Certificate cert, java.util.Collection<java.security.cert.CRL> crls, java.util.Calendar calendar)Verifies a single certificate.- Parameters:
cert- the certificate to verifycrls- the certificate revocation list ornullcalendar- the date ornullfor the current date- Returns:
- a
Stringwith the error description ornullif no error
-
verifyCertificates
public static java.util.List<VerificationException> verifyCertificates(java.security.cert.Certificate[] certs, java.security.KeyStore keystore, java.util.Collection<java.security.cert.CRL> crls, java.util.Calendar calendar)
Verifies a certificate chain against a KeyStore.- Parameters:
certs- the certificate chainkeystore- theKeyStorecrls- the certificate revocation list ornullcalendar- the date ornullfor the current date- Returns:
nullif the certificate chain could be validated or aObject[]{cert,error}wherecertis the failed certificate anderroris the error message
-
verifyCertificates
public static java.util.List<VerificationException> verifyCertificates(java.security.cert.Certificate[] certs, java.security.KeyStore keystore, java.util.Calendar calendar)
Verifies a certificate chain against a KeyStore.- Parameters:
certs- the certificate chainkeystore- theKeyStorecalendar- the date ornullfor the current date- Returns:
nullif the certificate chain could be validated or aObject[]{cert,error}wherecertis the failed certificate anderroris the error message
-
verifyOcspCertificates
public static boolean verifyOcspCertificates(org.bouncycastle.cert.ocsp.BasicOCSPResp ocsp, java.security.KeyStore keystore, java.lang.String provider)Verifies an OCSP response against a KeyStore.- Parameters:
ocsp- the OCSP responsekeystore- theKeyStoreprovider- the provider ornullto use the BouncyCastle provider- Returns:
trueis a certificate was found
-
verifyTimestampCertificates
public static boolean verifyTimestampCertificates(org.bouncycastle.tsp.TimeStampToken ts, java.security.KeyStore keystore, java.lang.String provider)Verifies a time stamp against a KeyStore.- Parameters:
ts- the time stampkeystore- theKeyStoreprovider- the provider ornullto use the BouncyCastle provider- Returns:
trueis a certificate was found
-
-