Skip to content
Guides

Verify Digital Certificates

When verifying digital certificates, the system automatically checks the trustworthiness of all certificates in the certificate chain and also verifies whether the certificates have expired. Only certificates that are both not expired and considered trustworthy in the entire certificate chain are considered trusted digital certificates.

This example shows how to verify digital certificates:

C#
// Verify certificate.
// 
// To verify the trustworthiness of a certificate, you need to verify that all certificates in the certificate chain are trustworthy.
// In ComPDFKit, this progress is automatic.
// You should call the "CPDFSignatureCertificate.CheckCertificateIsTrusted" first. Then you can view the "CPDFSignatureCertificate.IsTrusted" property.
//
CPDFSignatureCertificate certificate = CPDFPKCS12CertHelper.GetCertificateWithPKCS12Path(certificatePath, password);
certificate.CheckCertificateIsTrusted();
if (certificate.IsTrusted)
{
  // Certificate is trusted.
} 
else 
{
    // Certificate is not trusted.
}