Fill, lock and sign a contract
You have a contract as a PDF form, the signer's details, and your signing certificate. You want the filled contract, locked against edits, signed and timestamped.
Request
curl \
--request POST http://localhost:3000/forms/pdf/pipe \
--form files=@form.pdf \
--form files=@cert.pem \
--form files=@key.pem \
--form 'stages=[
{ "op": "set-form", "fields": { "name": "Ada Lovelace" } },
{ "op": "flatten-form" },
{ "op": "sign", "certificate": "cert.pem", "key": "key.pem", "reason": "Agreed", "pades": true, "timestampUrl": "http://timestamp.digicert.com" }
]' \
-o contract.pdf
Result
A PDF whose name field reads "Ada Lovelace" as part of the page, with a valid PAdES signature and a timestamp. A viewer flags the signer as untrusted here, because cert.pem is a self-signed test certificate.
How it works
set-formfills the field, andflatten-formburns it into the page: see Fill a form and Flatten a form.signcomes last, so nothing changes the PDF after it: see Sign a PDF.timestampUrlhas an authority vouch for the signing time.
Variations
- A PKCS#12 certificate: upload the
.p12ascertificate, with itscertificatePassword. - Don't know the field names: send a wrong one, and the 400 lists them.
- Keep a copy for the archive: add
{ "op": "remediate", "profile": "PDF/A-2b" }beforesign.