Sign with Digital Signature
Wordize supports digital signature in the document in some formats:
- to sign documents, use the Wordize Signature for .NET module
- to work with documents in the required formats, select the appropriate document conversion module
Please note that Wordize Signature for .NET currently only supports DOC, DOT, DOCX, DOTX, DOCM, ODT, OTT, and XPS formats.
Wordize allows users to digitally sign documents, ensuring their authenticity and integrity. A digital signature verifies that the document has not been altered after signing and confirms the signer’s identity. This feature is essential for legal documents, contracts, and other sensitive files.
With Wordize Signature for .NET, you can:
- sign documents programmatically
- remove signatures when needed
- work with cryptographic standards for secure signing
Sign a Document
To sign a document with a digital signature, use one of the Sign method and the CertificateHolder digital certificate.
CertificateHolder is a digital certificate that follows the internationally accepted X.509 PKI standard, ensuring the public key within the certificate is linked to the signer included inside the certificate.
A common scenario for signing a document is when the input document format matches the output document format. In such a scenario, there is no need to parse the document.
Wordize allows you to sign a document without loading the document into the internal Document Object Model in the following formats: Doc, Dot, Docx, Dotx, Docm, Dotm, Odt, Ott, Xps, and OpenXps. The Signer class provides a convenient way to perform this type of signing.
The following code example shows how to add a digital signature to a document using the Sign method:
CertificateHolder holder = CertificateHolder.Create("morzal.pfx", "wordize");
Signer.Sign("Document.docx", "SignedDocument.1.docx", holder);
Sign a Document Using Sign Options
In addition to the X.509 digital certificate, you can specify the document signing options using the following properties of the SignOptions class:
- Comments – to add a comment to your sign
- SignTime – to add the date of signing
- DecryptionPassword – to add a password to decrypt the source document
- ProviderId – to specify the signature provider class ID
- XmlDsigLevel – to specify the digital signature level based on the XML-DSig standard
The following code example shows how to digitally sign a document, specifying sign options:
SignOptions signOptions = new SignOptions();
signOptions.Comments = "My Signature";
signOptions.SignTime = DateTime.Now;
CertificateHolder holder = CertificateHolder.Create("morzal.pfx", "wordize");
Signer.Sign("Document.docx", "SignedDocument.3.docx", holder, signOptions);
Remove a Digital Signature
If you need to remove digital signatures from a document, use one of the RemoveAllSignatures methods.
The following code example shows how to remove a sign from a document:
Signer.RemoveAllSignatures("SignedDocument.docx", "UnsignedDocument.docx");