PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
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.
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.
| Field | Description |
|---|---|
signatureValid | Whether the cryptographic signature is valid |
documentUnmodified | Whether the document is unchanged after signing |
certificateTrusted | Whether the signing certificate is trusted in the current verification environment |
certificateExpired | Whether the signing certificate has expired |
timestampTrusted | Whether the timestamp is trusted |
timestampSource | Time source; see the timestamp guide |
embeddedTimestampValid | Whether the embedded timestamp is valid; optional |
ltvEnabled | Document-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.