Skip to content
DemoAPI ReferenceFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub
React Native Guides Verify digital signatures

Read and Verify Digital Signatures ​

Read signatures with getDigitalSignatures(), then pass each returned object's signatureIndex to verifyDigitalSignature(). This is the native signature index; do not replace it with an array position after filtering or sorting.

Read and Verify ​

ts
import { CPDFReaderView } from '@compdfkit_pdf_sdk/react_native';

async function verifySignatures(reader: CPDFReaderView) {
  const document = reader._pdfDocument;
  const signatures = await document.getDigitalSignatures();
  for (const signature of signatures) {
    const result = await document.verifyDigitalSignature(signature.signatureIndex);
    console.log(signature.fieldName, result.signatureValid,
      result.documentUnmodified, result.certificateTrusted);
  }
}

Call these methods after the reader finishes loading the document. getDigitalSignatures() returns CPDFDigitalSignature[], or an empty array when there are no signatures. Signature information includes the field name, page, bounds, signer name, date, reason, location, and permissions. signers contains verification states and certificate lists.

Interpret Verification Results ​

FieldDescription
signatureValidWhether the cryptographic signature is valid
documentUnmodifiedWhether the document is unchanged after signing
certificateTrustedWhether the signing certificate is trusted in the current verification environment
certificateExpiredWhether the signing certificate has expired
timestampTrustedWhether the timestamp is trusted
timestampSourceTime source; see the timestamp guide
embeddedTimestampValidWhether the embedded timestamp is valid; optional
ltvEnabledDocument-level long-term validation material state; optional

Assess these results separately. For example, a valid signature with an untrusted certificate still requires checking the certificate chain and trust configuration. An absent optional field means that information is unavailable, not that verification passed.

iOS may return post-signing changes in modifications; Android currently returns an empty array. Do not interpret an empty array as proof that the document is unchanged. Use the verification result.

Verification failures reject the Promise and must not be displayed as a successful verification. For the distinction between validation material and certificate trust, see Timestamps and Long-Term Validation.