Table of Contents

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

string

HAS_UNSUPPORTED_EXTENSIONS

public const string HAS_UNSUPPORTED_EXTENSIONS = "Has unsupported critical extension"

Field Value

string

Methods

VerifyCertificate(IX509Certificate, ICollection<IX509Crl>)

Verifies a single certificate for the current date.

public static string VerifyCertificate(IX509Certificate cert, ICollection<IX509Crl> crls)

Parameters

cert IX509Certificate

the certificate to verify

crls ICollection<IX509Crl>

the certificate revocation list or null

Returns

string

a String with the error description or null 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 IX509Certificate

the certificate to verify

crls ICollection<IX509Crl>

the certificate revocation list or null

calendar DateTime

the date, shall not be null

Returns

string

a String with the error description or null 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 a Object[]{cert,error} where cert is the failed certificate and error 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} where cert is the failed certificate and error 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 DateTime

the date, shall not be null

Returns

IList<VerificationException>

empty list if the certificate chain could be validated or a Object[]{cert,error} where cert is the failed certificate and error 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 DateTime

the date, shall not be null

Returns

IList<VerificationException>

null if the certificate chain could be validated or a Object[]{cert,error} where cert is the failed certificate and error 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 IBasicOcspResponse

the 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 ITimeStampToken

the time stamp

keystore List<IX509Certificate>

the KeyStore

Returns

bool

true is a certificate was found