Question content
I hope to be able touse itext to sign pdf files multiple times. But I don't have the private key. I'm generating a hash for the client to sign, and after re-signing, I call signDeferred()
. Is it possible to make multiple empty containers, generate a hash with all empty containers, and then add signatures as they appear?
I tried adding more than 1 empty container, generated the hash, client signed and returned the hash, I tried adding but got the error that it was not the last field. You can only call signDeferred
on the last field. But I don't know how to fix it since signDetached
is not an option since I don't have the private key.
Workaround
No, this is not possible, at least not for interoperable PDF signatures.
The reason is that there is no real concept of parallel signatures (or counter-signatures) specified for PDF, only the concept of serial signatures, one signature after another, with each new signature also overwriting all previous signatures:
(See this answer for more details.)
Strictly speaking, the PDF specification does not require signatures to cover all entire revisions except for placeholders embedded in the signature container itself, it just recommends it. Therefore, it is theoretically possible to create a PDF with multiple signatures, each covering the entire PDF except for all embedded signature values.
But in practice, the PDF signature validator rejects such constructs. Additionally, more modern signing profiles (particularly the PAdES baseline profile) do require signatures to cover all entire revisions except for signed container placeholders.
The above is the detailed content of Multiple contract extensions. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Notepad++7.3.1
Easy-to-use and free code editor

WebStorm Mac version
Useful JavaScript development tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)