Class CertificateVerification
- Namespace
- iText.Signatures
- Assembly
- itext.sign.dll
This class consists of some methods that allow you to verify certificates.
public class CertificateVerification
- Inheritance
-
CertificateVerification
- Inherited Members
Constructors
CertificateVerification()
public CertificateVerification()
Fields
CERTIFICATE_REVOKED
public const string CERTIFICATE_REVOKED = "Certificate revoked"
Field Value
HAS_UNSUPPORTED_EXTENSIONS
public const string HAS_UNSUPPORTED_EXTENSIONS = "Has unsupported critical extension"
Field Value
Methods
VerifyCertificate(IX509Certificate, ICollection<IX509Crl>)
Verifies a single certificate for the current date.
public static string VerifyCertificate(IX509Certificate cert, ICollection<IX509Crl> crls)
Parameters
cert
IX509Certificatethe certificate to verify
crls
ICollection<IX509Crl>the certificate revocation list or
null
Returns
- string
a
String
with the error description ornull
if no error
VerifyCertificate(IX509Certificate, ICollection<IX509Crl>, DateTime)
Verifies a single certificate.
public static string VerifyCertificate(IX509Certificate cert, ICollection<IX509Crl> crls, DateTime calendar)
Parameters
cert
IX509Certificatethe certificate to verify
crls
ICollection<IX509Crl>the certificate revocation list or
null
calendar
DateTimethe date, shall not be null
Returns
- string
a
String
with the error description ornull
if no error
VerifyCertificates(IX509Certificate[], List<IX509Certificate>)
Verifies a certificate chain against a KeyStore for the current date.
public static IList<VerificationException> VerifyCertificates(IX509Certificate[] certs, List<IX509Certificate> keystore)
Parameters
certs
IX509Certificate[]the certificate chain
keystore
List<IX509Certificate>the
KeyStore
Returns
- IList<VerificationException>
null
if the certificate chain could be validated or aObject[]{cert,error}
wherecert
is the failed certificate anderror
is the error message
VerifyCertificates(IX509Certificate[], List<IX509Certificate>, ICollection<IX509Crl>)
Verifies a certificate chain against a KeyStore for the current date.
public static IList<VerificationException> VerifyCertificates(IX509Certificate[] certs, List<IX509Certificate> keystore, ICollection<IX509Crl> crls)
Parameters
certs
IX509Certificate[]the certificate chain
keystore
List<IX509Certificate>the
KeyStore
crls
ICollection<IX509Crl>the certificate revocation list or
null
Returns
- IList<VerificationException>
empty list if the certificate chain could be validated or a
Object[]{cert,error}
wherecert
is the failed certificate anderror
is the error message
VerifyCertificates(IX509Certificate[], List<IX509Certificate>, ICollection<IX509Crl>, DateTime)
Verifies a certificate chain against a KeyStore.
public static IList<VerificationException> VerifyCertificates(IX509Certificate[] certs, List<IX509Certificate> keystore, ICollection<IX509Crl> crls, DateTime calendar)
Parameters
certs
IX509Certificate[]the certificate chain
keystore
List<IX509Certificate>the
KeyStore
crls
ICollection<IX509Crl>the certificate revocation list or
null
calendar
DateTimethe date, shall not be null
Returns
- IList<VerificationException>
empty list if the certificate chain could be validated or a
Object[]{cert,error}
wherecert
is the failed certificate anderror
is the error message
VerifyCertificates(IX509Certificate[], List<IX509Certificate>, DateTime)
Verifies a certificate chain against a KeyStore.
public static IList<VerificationException> VerifyCertificates(IX509Certificate[] certs, List<IX509Certificate> keystore, DateTime calendar)
Parameters
certs
IX509Certificate[]the certificate chain
keystore
List<IX509Certificate>the
KeyStore
calendar
DateTimethe date, shall not be null
Returns
- IList<VerificationException>
null
if the certificate chain could be validated or aObject[]{cert,error}
wherecert
is the failed certificate anderror
is the error message
VerifyOcspCertificates(IBasicOcspResponse, List<IX509Certificate>)
Verifies an OCSP response against a KeyStore.
public static bool VerifyOcspCertificates(IBasicOcspResponse ocsp, List<IX509Certificate> keystore)
Parameters
ocsp
IBasicOcspResponsethe OCSP response
keystore
List<IX509Certificate>the
KeyStore
Returns
- bool
true
is a certificate was found
VerifyTimestampCertificates(ITimeStampToken, List<IX509Certificate>)
Verifies a time stamp against a KeyStore.
public static bool VerifyTimestampCertificates(ITimeStampToken ts, List<IX509Certificate> keystore)
Parameters
ts
ITimeStampTokenthe time stamp
keystore
List<IX509Certificate>the
KeyStore
Returns
- bool
true
is a certificate was found