PDF Signing API
At a high level, the signing process is:
- Create a CMS placeholder that will hold the CMS signature
- Compute the PDF’s SHA-256 digest, not including the bytes in the CMS placeholder (but including the
ByteRange
used to define it) - Invoke this API to compute the CMS using the digest and the signing certificate
- Apply the CMS into the placeholder
This document covers step #3; the other steps are out of its scope. Please refer to Adobe’s Documentation for more details.
We recommend you use an existing library in your stack for the remaining steps, or simply use our CLI.
API: POST /api/v1/sign
Given a PDF digest and authentication, returns a CMS to embed in the PDF placeholder.
Request Headers
- X-Authorization-Algorithm: Must be set to
HmacSHA256
. - X-Authorization-Time: Current ISO 8601 time; your clock must be accurate to within one minute of the correct time.
- X-Authorization-Key: API key id; a UUID assigned by us
- X-Authorization: Base64(Hmac-SHA256(API Key, (message + ISO 8601 time sent above)))
The X-Authorization
header is computed by taking the SHA-256 of the message body (UTF-8 encoded), appending the current time in ISO-8601 format (YYYY-MM-DDTHH:MM:SS.000Z
), and applying HMAC-SHA256 to it using your API Key. The resulting Hmac must be base64 encoded. The server will compute the same HMAC with its copy of your API key; if they match the request will proceed, any other condition will result in a HTTP 401 error.
Sample HTTP request
Given:
- The current time is
2025-04-13T18:21:44.040Z
- The API key ID is
9eacf1f6-7b34-4752-0e3c-0a96baf273aa
- The API Key is (hex-encoded; you must use the raw bytes):
c80dd3f9db3330aa5daae1b469613cce2212e2beba7882b08fcc80acedba4c43
- The body of the message is
{ "digest": "wriYLGsKP7H91843t7svOIfoxxErUkJWdemTY1yQs1E=" }
Then the resulting HTTP request should be exactly this:
|
|
Request Body
The request body is a simple JSON object:
|
|
CMS Placeholder size
The CMS placeholder you create must be large enough to hold the CMS. Since the CMS placeholder must be inserted into the PDF before calculating the digest, and the size of the CMS is unknown prior to signing, we recommend you allocate 10KB (10,240 bytes) for your CMS placeholder.
The PDF Digest
The digest you send to us must be computed using the SHA-256 algorithm. Other algorithms will be supported in future versions of the API.
Response Body
The response body is also simple:
|
|
Applying the CMS
The API returns the CMS that contains the signature. You must decode the CMS, encode it as hexadecimal and into the CMS placeholder you created, padding any remaining space with 00
.
Want a
?
Trusted Signatures provides the fastest, most affordable, secure PDF signatures on the internet.