Digital Signatures

Sign a PDF (Base64)

Digitally sign a PDF using a PKCS#12 certificate. The certificate can be referenced by name (pre-uploaded) or provided inline as Base64. Optionally includes a visible signature and/or a trusted timestamp.

post/api/signatures/sign

Request

  • Base URL: https://api.dokmatiq.com
  • URL: https://api.dokmatiq.com/api/signatures/sign
  • Auth: API key in header X-API-Key

Headers

X-DocGen-Validatestring

Request body

pdfBase64string required

Base64-encoded PDF to sign

certificateNamestring

Name of a pre-uploaded certificate (stored on server)

certificateBase64string

Base64-encoded PKCS#12 (.p12/.pfx) certificate (inline, alternative to certificateName)

certificatePasswordstring required

Password for the PKCS#12 certificate

reasonstring

Reason for signing

locationstring

Location of signing

contactInfostring

Contact information of the signer

signerNamestring

Name of the signer (if not extracted from certificate)

timestampUrlstring

URL of a Timestamp Authority (TSA) server for trusted timestamps. Examples: http://timestamp.digicert.com, http://tsa.swisssign.net

Example request

{
  "pdfBase64": "JVBERi0xLjcK...",
  "certificateName": "firma-zertifikat",
  "certificateBase64": "MIIKcQIBAzCC...",
  "certificatePassword": "geheim",
  "reason": "Rechnungsfreigabe",
  "location": "Berlin",
  "contactInfo": "buchhaltung@firma.de",
  "signerName": "Max Mustermann",
  "timestampUrl": "http://timestamp.digicert.com",
  "visibleSignature": {
    "page": 1,
    "x": 20,
    "y": 20,
    "width": 60,
    "height": 20,
    "text": "Digital signiert von\\n${signer}\\n${date}",
    "fontSize": 8
  }
}

Response

Signed PDF

Changes

No recorded changes to this operation across all 1 revision of this API.