x
Skip to main content

Certificate Signing

Digitally sign PDFs with X.509 certificates and validate existing signatures against trusted certificate chains.


Signing PDFs

Easiest option - uses an auto-generated server certificate. No setup needed for users.

  1. Go to Certificate Sign tool
  2. Upload PDF
  3. Select "Sign with Stirling PDF"
  4. Configure signature appearance (optional)
  5. Sign and download

Configuration:

system:
serverCertificate:
enabled: true
organizationName: Stirling-PDF
validity: 365
regenerateOnStartup: false

Signature Appearance

Visible: Appears as a box on the PDF page with configurable position, size, page, and displayed text (name, date, reason).

Invisible: Embedded in PDF metadata only, not visible on the page.


Validating Signatures

Verify that a PDF was signed by the claimed certificate, the certificate is trusted, the PDF hasn't been modified, and the certificate hasn't been revoked.

Trust Sources

SourceConfig KeyWhat It Trusts
Server certificatesserverAsAnchorPDFs signed by your Stirling PDF instance
System trust storeuseSystemTrustOS-trusted CAs
Mozilla CA bundleuseMozillaBundleMozilla's curated CA list
Adobe AATLuseAATLAdobe Approved Trust List
EU EUTLuseEUTLEU Trusted List (eIDAS)

Revocation Checking

Certificates can be revoked (invalidated) after they're issued - for example if a private key is compromised. Revocation checking lets Stirling PDF verify that a certificate is still valid at the time of use.

security:
validation:
revocation:
mode: none # Options: none, ocsp, crl, ocsp+crl
hardFail: false
ModeWhat it does
noneSkip revocation checks entirely
ocspCheck in real-time against the certificate authority's server (requires internet)
crlDownload a list of revoked certificates (can work offline with cached lists)
ocsp+crlTry real-time check first, fall back to the list if that fails

hardFail controls what happens when the revocation check itself fails (e.g. server unreachable):

  • false (default) - validation passes with a warning
  • true - validation fails entirely. Use this in high-security environments where you'd rather reject a signature than skip the check.

Configuration Examples

system:
serverCertificate:
enabled: true

security:
validation:
trust:
serverAsAnchor: true
useSystemTrust: true

API Usage

curl -X POST http://stirling-pdf:8080/api/v1/security/cert-sign \
-F "[email protected]" \
-F "certType=server" \
-F "reason=Approved" \
-F "location=bottom-right" \
-F "showSignature=true" \
-o signed.pdf

See API Documentation for complete endpoint reference.


Troubleshooting

"Certificate not trusted"

Enable the appropriate trust source in config, or add your CA certificate to the system trust store:

docker cp ca-cert.crt stirling-pdf:/usr/local/share/ca-certificates/
docker exec stirling-pdf update-ca-certificates

Revocation check fails

Check that the container has HTTPS access to OCSP/CRL servers. Use hardFail: false or switch to crl mode for restricted networks.

Server certificate not generated

Ensure SYSTEM_SERVERCERTIFICATE_ENABLED=true is set. Check logs with docker logs stirling-pdf | grep -i certificate.