Multi-signature
Single, MultiShared, and MultiChained layouts, plus multi-party re-signing that keeps every prior signature valid
Two different questions hide behind "multi-signature":
- One signer, several boxes — how should one signature be laid out across pages? That's the
Method. - Several signers, over time — how does a second party sign a document the first already
signed? That's re-signing, which
sign_pdfhandles automatically.
Method — laying out one signing operation
Method decides how the field(s) created in a single sign_pdf call relate to the actual
cryptographic signature value:
Method | Result | Revisions |
|---|---|---|
Single (default) | ONE signature, a clickable widget on every resolved page | one |
MultiShared | N separate fields sharing one signature value (Adobe shows N "Rev 1") | one |
MultiChained | N independent signatures, each its own revision | N (rev1 → revN) |
use mudrit_pdfsign::prelude::*;
let cfg = SignConfig::builder()
.place("A", [40, 40, 200, 100])? // a box on every page
.method(Method::Single) // one signature, shown on all of them
.build();let cfg = SignConfig::builder()
.place("F", [40, 40, 200, 100])?
.place("L", [350, 60, 560, 160])? // two fields…
.method(Method::MultiShared) // …sharing ONE signature value (one revision)
.build();let cfg = SignConfig::builder()
.place("F", [40, 40, 200, 100])?
.place("L", [350, 60, 560, 160])? // two fields…
.method(Method::MultiChained) // …two independent signatures, one revision each (approval only)
.build();Which one?
Use Single for the usual "sign once, show the stamp on every page" case — one signature, one
revision, the lightest file. Use MultiShared when you want several distinct fields to reference
the same signing act (e.g. an initials box and a full stamp) in a single revision. Use
MultiChained only when you genuinely need N independent signatures in one call, each as its own
revision — it is approval-only (certification is ignored for it).
Multi-party re-signing
You don't choose "sign" vs "add signature" — sign_pdf detects it. If the input is already signed,
it appends a new signature as an incremental revision, so the existing signatures stay valid,
instead of a fresh sign that would rebuild and break them.
let once = sign_pdf(&pdf, &signer_a, &cfg)?; // signer A — first signature
let twice = sign_pdf(&once, &signer_b, &cfg)?; // signer B — auto-appended; both validThis works on plain and password-protected documents. When the already-signed input is also encrypted, pass the open password and the appended revision is encrypted with the document's own file key — so the output stays protected under the same password and cipher:
let resigned = sign_pdf(PdfReader::from(signed_protected).password("asd"), &signer_b, &cfg)?;See the resign_multiparty example (signer A then B, plain and protected).
Certified variants
Certification composes with the layout methods. A certified Single signature shows one entry in
Adobe's Signatures panel; a certified MultiShared shows N entries that share the one signature
value. Both keep DocMDP validity, and either can be combined with output encryption (see the
certified_variants example — certified Single, certified MultiShared, and encrypted).
Certification is first-only and not chained
A certifying signature must be the first signature, and MultiChained
is approval-only — so certify with Single or MultiShared, then let later parties append approval
signatures.