How to search for Digital signatures

GroupDocs.Signature offers the ability to find Digital signatures that are applied to a document and returns its digital signature certificate.
Please follow these steps to search for Digital signatures within the document:

  • Create a new instance of the Signature class and pass the source document path as a constructor parameter.
  • Instantiate the DigitalSearchOptions object according to your requirements and specify search options.
  • Call the Search method of the Signature class instance and pass the DigitalSearchOptions to it. This example shows how to search for Digital signature in the document and analyze digital signature certificate.
  // The path to the documents directory.
  const filePath = Constants.SAMPLE_SIGNED_MULTI; 

  const signature = new signatureLib.Signature(filePath);
  const options = new signatureLib.DigitalSearchOptions();

  // Search for signatures in the document
  const signatures = signature.search(signatureLib.DigitalSignature.class, options).toArray();
  console.log('\nSource document contains the following digital signatures.');

  for (const digitalSignature of signatures) {
    console.log(`Digital signature found from ${digitalSignature.getSignTime()} with validation flag ${digitalSignature.isValid()}. Certificate SN ${digitalSignature.getCertificate().getType()}`);
  }

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.