Signature verification results

The rows that verify() returns and the verify event carries are plain objects, one per signature, newest first. This page lists their fields. A row of a check that failed (status "unknown", code "INTERNAL_ERROR") has only the PDF's own fields, status, code, message and warnings.

Identity and widgets

name

String. The signature field's full name.

fieldName

String. The field's own name (/T); "" without one.

id

String. An opaque id: the field and the bytes it signs.

kind

"signature" or "document-timestamp". A signature, or an RFC 3161 document timestamp.

page

Number or null. The page of its first widget.

widgets

Array. The field's widgets; empty when the field cannot be found.

widgets[].id

String. The widget's annotation id.

widgets[].page

Number or null. Its page.

widgets[].rect

[x1, y1, x2, y2] or null. Its rectangle, in PDF points.

widgets[].visible

Boolean. Shown: more than 1 pt wide and high, not hidden.

Verdict

status

"verified" or "unknown" or "untrusted" or "expired" or "revoked" or "invalid". The verdict; see the codes.

code

String or null. Why, for example "EXPIRED"; null when verified.

errorCode

String or null. The same reason as Firefox names it, for example "SEC_ERROR_EXPIRED_CERTIFICATE".

message

String or null. The reason, in English.

warnings

Array. What is worth knowing but does not change the verdict.

warnings[].code

String. For example "MODIFIED", "REVOCATION_UNKNOWN", "TRUST_SOURCE_FAILED", "WEAK_SHA1".

warnings[].message

String. The warning, in English.

The signature dictionary

signerName

String or null. The signer as the PDF names it (/Name), unverified; the verified name is certificate.subjectCN.

reason

String or null. Why the signer says they signed (/Reason).

location

String or null. Where the signer says they signed (/Location).

contactInfo

String or null. How to reach the signer, in their words (/ContactInfo).

signingTime

String or null. The claimed signing time as written (/M), for example "D:20250101120000+01'00'".

signedAt

Date or null. The same time as a Date.

filter

String or null. The signature handler (/Filter), for example "Adobe.PPKLite".

subFilter

String or null. The format (/SubFilter): "adbe.pkcs7.detached" "adbe.pkcs7.sha1" "ETSI.CAdES.detached" "ETSI.RFC3161".

signatureType

0 or 1 or null. PDF.js's number for the format: 0 adbe.pkcs7.detached, 1 adbe.pkcs7.sha1.

byteRange

[start, length, start, length]. The bytes it signs (/ByteRange).

Revisions

revisionIndex

Number. Its rank, the newest 0.

parentId

String or null. The id of the next newer signature.

coversWholeDocument

Boolean. Nothing but whitespace follows the bytes it signs.

documentModifiedAfterSigning

Boolean. The document changed after it was signed: !coversWholeDocument.

modificationsAfterSignature

Number or null. Updates saved after it.

laterSignatures

Number. Signatures and document timestamps added after it.

laterTimestamps

Number. The document timestamps among them.

onlyLaterSignatures

Boolean. Every later update added a signature (counted, not inspected).

Time

time

Object or null. The time the certificates are checked at; null when the bytes do not check out.

time.value

String (ISO 8601). That time.

time.source

"timestamp" or "signingTime" or "M" or "now". Where it comes from: a trusted timestamp, the signer's clock, the PDF date, or now.

time.trusted

Boolean. Vouched for by a trusted time-stamp authority.

time.claimed

Object. The times the signer claims.

time.claimed.signingTime

String (ISO 8601) or null. The signer's clock (the CMS signing-time attribute).

time.claimed.M

String (ISO 8601) or null. The PDF date (/M).

Timestamp

timestamp

Object or null. Its RFC 3161 timestamp; null without one.

timestamp.status

"trusted" or "untrusted" or "invalid" or "unknown". Trusted: from a trusted authority, valid then · untrusted: valid, the authority not trusted · invalid: unreadable or not matching · unknown: an unsupported hash.

timestamp.genTime

String (ISO 8601) or null. When the authority stamped it.

timestamp.accuracyMs

Number or null. Its stated accuracy, in ms (0 when not stated).

timestamp.policy

String or null. The authority's policy OID.

timestamp.serialNumber

String or null. The token's serial number, in colon hex.

timestamp.imprintAlgorithm

String or null. The hash it stamps, for example "SHA-256".

timestamp.tsa

String or null. The authority's common name.

timestamp.certificate

Object or null. The authority's certificate, like certificate (no chain).

timestamp.errorCode

String or null. Why it is not trusted.

timestamp.message

String or null. The same, in English.

Integrity

integrity

Object. The checks of the signed bytes and the signature.

integrity.status

"ok" or "unknown". "ok" once both check out; failures show in status.

integrity.digestAlgorithm

String or null. For example "SHA-256".

integrity.signatureAlgorithm

String or null. For example "rsaEncryption", "ecdsa-with-SHA256".

integrity.signedAttributes

Boolean or null. It signs CMS attributes too (time, certificate).

integrity.byteRange

Object or null. The check of byteRange.

integrity.byteRange.gap

Number. Bytes between the two signed ranges.

integrity.byteRange.contentsLength

Number. Bytes of the signature.

integrity.byteRange.ok

true or null. The gap holds the signature and nothing else.

Certificate

certificate

Object or null. The signer's certificate (the time-stamp authority's for a document timestamp).

certificate.subject

String. Its subject, for example "CN=⋯, O=⋯, C=⋯".

certificate.issuer

String. Its issuer, the same way.

certificate.subjectCN

String. The subject's common name (else its organization, else its unit).

certificate.issuerCN

String. The issuer's common name.

certificate.email

String or null. The subject's email address.

certificate.organization

String or null. The subject's organization.

certificate.notBefore

String (ISO 8601). Valid from.

certificate.notAfter

String (ISO 8601). Valid until.

certificate.serialNumber

String. In colon hex.

certificate.fingerprintSha256

String. The SHA-256 of the certificate, in colon hex.

certificate.derBase64

String. The certificate itself: DER, in base64.

certificate.publicKey

String. For example "RSA 3072", "EC P-384", "Ed25519".

certificate.signatureAlgorithm

String. How its issuer signed it, for example "sha256WithRSAEncryption".

certificate.keyUsage

[String]. For example "digitalSignature", "nonRepudiation".

certificate.extKeyUsage

[String]. For example "documentSigning", "timeStamping".

certificate.isCA

Boolean. A certificate authority.

certificate.selfSigned

Boolean. Issued to itself: the same subject and issuer.

certificate.policies

[String]. Its policy OIDs.

certificate.qc

Object or null. Its EU qualified statements.

certificate.qc.compliance

Boolean. An EU qualified certificate.

certificate.qc.sscd

Boolean. Its key is on a qualified signature creation device.

certificate.chain

Array. The path to a trust anchor (when untrusted, the longest path found); each one has the fields of certificate but chain, and:

certificate.chain[].role

"signer" or "tsa" or "intermediate" or "anchor". Its place in the path.

certificate.chain[].validAtT

Boolean. Valid at time.value.

certificate.chain[].revocation

Object or null. Its revocation check: the same object as in revocation.checked.

Trust

trust

Object. The path to a trust anchor.

trust.status

"trusted" or "untrusted" or "unsupported". Whether the path reaches a trust anchor.

trust.anchor

Object or null. The anchor reached, like certificate.

trust.errorCode

String or null. Why it is not trusted.

Validity

validity

Object. The validity periods along the path.

validity.status

"ok" or "expired" or "notYetValid" or null. null when not checked.

validity.at

String (ISO 8601) or null. The time checked: time.value.

validity.cert

Object or null. The first certificate not valid then, like certificate.

Revocation

revocation

Object. The revocation checks.

revocation.status

"good" or "revoked" or "unknown" or "skipped". "skipped" when the path is not trusted.

revocation.checked

Array. One check per certificate of the path but the anchor.

revocation.checked[].fingerprintSha256

String. The certificate checked.

revocation.checked[].subjectCN

String. Its common name.

revocation.checked[].status

"good" or "revoked" or "unknown" or "not-checked". "not-checked": an OCSP responder that needs no check.

revocation.checked[].source

"embedded-ocsp" or "embedded-crl" or "ocsp" or "crl" or null. Where the answer came from.

revocation.checked[].url

String or null. The URL asked online.

revocation.checked[].thisUpdate

String (ISO 8601) or null. When the answer was issued.

revocation.checked[].nextUpdate

String (ISO 8601) or null. When the next one is due.

revocation.checked[].producedAt

String (ISO 8601) or null. When the OCSP responder signed it.

revocation.checked[].revocationTime

String (ISO 8601) or null. When it was revoked.

revocation.checked[].reason

String or null. Why, for example "keyCompromise".

revocation.checked[].revokedLater

Boolean. Revoked only after a trusted signing time, so still good.

Timing

elapsedMs

Number. How long the check took, in ms.

Certificates

trust.anchor, validity.cert, timestamp.certificate and each certificate.chain entry are certificates with the fields of certificate.

Statuses and codes

Each status comes with one of these codes:

StatusCodes
"invalid"MALFORMED_SIGNATURE BYTE_RANGE_MISMATCH DIGEST_MISMATCH SIGNATURE_MISMATCH ESS_CERT_MISMATCH ALG_PROTECTION_MISMATCH ENVELOPED_CONTENT NO_SIGNER ALGORITHM_DISABLED
"revoked"REVOKED
"expired"EXPIRED NOT_YET_VALID EXPIRED_ISSUER NOT_YET_VALID_ISSUER
"untrusted"NO_ANCHORS UNKNOWN_ISSUER SELF_SIGNED UNTRUSTED_ISSUER BAD_CERT_SIGNATURE CA_INVALID KEY_USAGE PATH_LEN UNKNOWN_CRITICAL_EXTENSION NAME_CONSTRAINTS CERT_ALG_DISABLED ALG_MISMATCH_CERT INADEQUATE_CERT_TYPE WEAK_KEY
"unknown"WEBCRYPTO_UNAVAILABLE SUBFILTER_NOT_SUPPORTED UNSUPPORTED_ALGORITHM NOCERT INTERNAL_ERROR
"verified"null

Warnings

A row's warnings can include:

CONTENTS_TRAILING_DATA WEAK_SHA1 WEAK_RSA_KEY RSA_SIGNATURE_SHORT RSA_DIGESTINFO_WITHOUT_NULL SIGNED_ATTRS_NOT_DER DIGEST_ALG_IS_SIGNATURE_ALG ALG_MISMATCH DEPRECATED_SUBFILTER MULTIPLE_SIGNERS SIGNER_ID_MISMATCH EKU_NOT_DOCUMENT_SIGNING NO_ESS TIME_FROM_SIGNER_CLOCK SIGNING_TIME_IN_FUTURE SIGNING_TIME_MISMATCH TIMESTAMP_IMPRINT_MISMATCH TIMESTAMP_INVALID TIMESTAMP_UNTRUSTED REVOKED_AFTER_SIGNING REVOCATION_UNKNOWN REVOCATION_UNREACHABLE CRL_ISSUER_NO_CRLSIGN TRUST_CERT_UNREADABLE TRUST_INPUT_UNRECOGNIZED TRUST_SOURCE_FAILED MODIFIED

MODIFIED is left out when only signatures and timestamps were added later. The cards leave out MODIFIED and REVOCATION_UNKNOWN, because their check lines already show them.

Default policy

Examples

Listing who signed

js
const rows = await document.querySelector("pdf-file").verify();
for (const row of rows) {
  console.log(row.status, row.certificate?.subjectCN, row.signedAt);
}

Specifications

Not part of any specification. <pdf-file> and <pdf-page> are autonomous custom elements defined by WebPDF.pro. It implements:

Specification
ISO 32000-2:2020 (PDF 2.0)
# 12.8 Digital signatures
RFC 5652: Cryptographic Message Syntax
RFC 3161: Time-Stamp Protocol
RFC 5280: X.509 certificates and CRLs
RFC 6960: OCSP

See also