Sign document with XAdES Digital signature

Note
This feature is supported only for Spreadsheet document types

GroupDocs.Signatureย providesย DigitalSignOptionsย classย to specify different amount of settings for Digital signature same as property XAdES of XAdES enumeration type. This property specifies the implementation of XAdES format for Spreadsheet documents only (for now).

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

  • Create new instance ofย Signatureย class and pass source document path as a constructor parameter.
  • Instantiate theย DigitalSignOptionsย object with required certificate and its password.
  • Set property XAdESType to value XAdES
  • Callย Signย method ofย ย Signatureย class instance and passย DigitalSignOptionsย to it.
  • Analyzeย SignResultย result to check newly created signatures if needed.

This example shows how to add Digital signature to document.ย Seeย SignResult

using (Signature signature = new Signature("sample.xlsx"))
{
    DigitalSignOptions options = new DigitalSignOptions("certificate.pfx")
    {
        // set XAdES type
        XAdESType = XAdESType.XAdES,
        // certificate password
        Password = "1234567890",
        // digital certificate details
        Reason = "Sign",
        Contact = "JohnSmith",
        Location = "Office1"
    };
    SignResult signResult = signature.Sign(outputFilePath, options);
}

More resources

GitHub Examples

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

Free Online Apps

Along with the full-featured .NET library, we provide simple but powerful free online apps.

To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the GroupDocs.Signature App Product Family.