eSign document with Digital signature

What is a Digital Signature?

A digital electronic signature is a scheme for verifying the document’s authenticity. A valid digital signature gives a recipient very strong reason to believe that the document was created or updated by a known sender and that the document was not altered by unknown source. For documents, the digital signature is represented by certificate with private (to sign) and public (to verify) keys. Most often certificates of various public key cryptography standards are used for this purpose, for example PFX format (see specification here). These digital signature certificates could be obtained from the operation system or generated manually with proper tools or trusted sources.

Digital signature as certificate file of PFX format allows to sign document after each creation or change with certificate and specify several optional parameters like subject, title, reason, contact etc. Most document viewers or editors support digital signatures verification that allows users to ensure document is from trusted source. Office documents format such as Word processing documents (DOC, DOCX, ODT, OTT), Spreadsheet files (XLSX, XLS, ODS, OTS) support digital signature without any visual appearance on document pages. PDF document format supports digital signature with alternative visual appearance on specific document page with custom image and labels. Picture below shows how digital signature looks by default on PDF document page..

Digital

How to eSign document with Digital signature

GroupDocs.Signature supports creation of digital signature based on existing PFX certificate. To specify different settings library provides DigitalSignOptions class that allows to adjust digital signature properties in the document:

  • Certificate source from FilePath or Stream;
  • Certificate password;
  • ContactReason and Location properties to set additional description;
  • Visible property to specify whether signature should be visible on document page or not;
  • XAdES type to specify whether e-signature should be of Xml Advanced Electronic Signature type.

Here are the steps to add Digital signature into document with GroupDocs.Signature:

This example shows how to sign PDF document with digital e-signature.

using (Signature signature = new Signature("sample.pdf"))
{
    // initialize digital option with certificate file path
    DigitalSignOptions options = new DigitalSignOptions("certificate.pfx")
    {
        // optional: setup image file path
        ImageFilePath = "sample.jpg",

        // set signature position
        Left = 100,
        Top = 100,

        // set
        Password = "1234567890"
    };
    signature.Sign("sampleSigned.pdf", options);
}

Advanced Usage Topics

To learn more about document eSign features, please refer to the advanced usage section.

More resources

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App

Along with full-featured .NET library we provide simple, but powerful free Apps.

You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online GroupDocs Signature App.