Sign with Digital Signature

Wordize Signature for .NET allows you to work with the digital signature in the document. You can sign a document or remove a digital signature.
What is this page about?
This page describes how to digitally sign or remove signatures in Wordize documents programmatically, using X.509 certificates and cryptographic signing options.
Supported Modules and Document Formats

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");

See Also

FAQ

  1. Q: Which file formats can be digitally signed with Wordize Signature for .NET?
    A: The module supports DOC, DOT, DOCX, DOTX, DOCM, DOTM, ODT, OTT, XPS, and OpenXPS formats. The input and output formats must be the same for a direct signing operation.

  2. Q: Do I need to load the document into the Wordize DOM to apply a digital signature?
    A: No. When the source and target formats match, you can sign the file directly using the static Signer.Sign method without loading it into the DOM, which improves performance.

  3. Q: How can I add a comment or signing time to a digital signature?
    A: Create a SignOptions object, set the Comments and SignTime properties, and pass it to the overload of Signer.Sign that accepts SignOptions.

  4. Q: What should I do if I need to remove an existing digital signature from a document?
    A: Use Signer.RemoveAllSignatures, providing the signed file path and the desired output path for the unsigned document.

  5. Q: Can I sign a password‑protected document?
    A: Yes. Set the DecryptionPassword property in SignOptions with the password required to open the source document before signing.