Overview
A signed PDF document carries its own proof: of who signed it, and that nobody changed it afterward. Any recipient can check that proof in a PDF reader, without access to your application or your systems. TX Text Control .NET for WPF creates such signatures when it saves a document as PDF, whether the document comes from the TextControl in your window or was generated in code. The concepts behind signatures, the classes that take part and the workflows a WPF application builds from them are summarized below.
A first signed document is created in Digitally Sign a PDF in Getting Started, from a button in MainWindow.xaml.
What a Signature Proves and What It Doesn't
A digital signature gives the recipient of a PDF two guarantees:
- Integrity. A change to the document after signing makes the signature invalid, and PDF readers report it.
- Authenticity. The certificate of the signature identifies the signer. Recipients trust it when it was issued by a certificate authority (CA) they trust. Self-signed certificates are for tests and internal documents.
Two things are outside what a signature proves:
- The time of signing. Without a time server, the date and time come from the clock of the signing computer. A trusted timestamp is the subject of Timestamp Configuration.
- Confidentiality. A signed document can be read by anyone who has the file. Passwords and permissions protect the content, as Passwords and Access Permissions describes, and a document can have both. Protections of TX Text Control in Security compares what each mechanism protects against.
Electronic Signatures and Digital Signatures
- An electronic signature is a visible mark: a scanned handwritten signature, a typed name, a stamp. In a TX Text Control document, it's the image shown in a signature field. It isn't secured cryptographically by itself.
- A digital signature binds the document to the signer's certificate and is secured cryptographically. TX Text Control creates it while it saves the PDF.
Most signing processes combine both: a signature field shows the image of a handwritten signature, and a certificate signs that field. A digital signature of the whole document, on the other hand, has no visible representation on the pages.
Two Ways to Sign
Signatures are created only when a document is saved as PDF or PDF/A. For all other formats, the signature settings have no meaning.
- The whole document gets one invisible signature, the usual choice when an organization certifies a generated invoice or report. See Signing PDF Documents.
- Signature fields get one signature each, with the image the field shows. Several people can sign one document this way. See Signature Fields and Signature Appearance and Multiple Signatures.
Signing PDF and PDF/A documents was introduced in version 17.0, and signature fields in version 31.0. The fields are saved with the TX Text Control format, DOCX and RTF too, so a document can travel between signers in an editable format; only the save as PDF applies the certificates.
Adobe Acrobat Reader lists the signatures of a document in its Signatures panel, including the field of each signature. A whole-document signature appears as an invisible signature:

The Classes and Controls Involved
| Part | Role | Described in |
|---|---|---|
| DigitalSignature | Holds the certificate, the URL of a time server and, for a signature field, the name of the field | Certificates |
| SaveSettings.DigitalSignature | Signs the whole document when it's saved | Signing PDF Documents |
| SaveSettings.SignatureFields | Signs named signature fields, one DigitalSignature per field | Signature Fields and Signature Appearance |
| SignatureField, SignatureImage, SignerData | A field in the document, its image and the data of the suggested signer | Signature Fields and Signature Appearance |
| WPF.TextControl.SignatureFields | The signature fields of the document in the editor | Signature Fields in Document Editor |
| RibbonInsertTab, RibbonFrameLayoutTab | Let users insert signature fields and enter the signer data on the ribbon | Signature Fields in Document Editor |
| ServerTextControl | Creates, merges and signs documents in code, without a window | Signing PDF Documents |
The signature classes are in the TXTextControl namespace and are the same in all .NET products of TX Text Control; only the editor, TXTextControl.WPF.TextControl, and its ribbon are WPF classes. DigitalSignature takes a .NET X509Certificate2 with its private key, from a .pfx file or the Windows certificate store, as Certificates describes.
Signing on the User's Computer
A WPF application signs on the computer it runs on. The certificate with its private key therefore has to be available there:
- Personal certificates are installed in the user's Windows certificate store, possibly on a smart card or USB token, and the user picks one when signing. The private key stays on the user's computer.
- An organization's certificate that certifies generated documents must be protected on every computer that signs with it, and never shipped with the application, as Certificate and Private Key Handling describes.
For a trusted timestamp, the computer needs a connection to the time server while it saves. Only a hash of the signature is sent there, not the document.
Typical Workflows
- Sign what the user wrote. The user edits a document in the window, and a button saves it as a signed PDF, to a fixed path or through the Save As dialog box.
- Generate and sign. A
ServerTextControlmerges a DOCX template with data and saves a signed PDF/A document, while the editor stays untouched. - Collect signatures, then certify. A document with one named field per signer travels from person to person in the TX Text Control format, and the last step signs all fields at once.
- Archive for the long term. Documents signed with a CA certificate and a trusted timestamp are archived unchanged.
Next Steps
- Signing PDF Documents: sign the document of the editor or a generated one.
- Certificates: load certificates and let users choose theirs.
- Signature Fields and Signature Appearance: sign visible signature fields.
- Timestamp Configuration: add a trusted signing time.