Skip to main content
All docs
V24.1

SignatureValidationOptions Class

Contains signature validation options.

Namespace: DevExpress.Office.DigitalSignatures

Assembly: DevExpress.Docs.v24.1.dll

NuGet Package: DevExpress.Document.Processor

Declaration

public class SignatureValidationOptions

Remarks

The SignatureValidationOptions object allows you to specify signature validation options (signature or timestamp certificate policy, decryption password, etc.). Use the SignatureValidationOptions.ValidationFlags property to exclude validation steps.

If the document to be validated is encrypted, specify the SignatureValidationOptions.DecryptionPassword property to decrypt the document. Otherwise, the Result property returns PackageSignatureValidationResult.PackageOpenFailed.

The code sample below shows how to specify signature validation options:

using DevExpress.Office.DigitalSignatures;
using System.Diagnostics;
using System.Net;

static void Main(string[] args)
{
    ValidateSignature("Template_signed.xlsx");
}

private static void ValidateSignature(string path)
{
    DocumentSigner validator = new DocumentSigner();

    //In this example, certificate validation is skipped
    SignatureValidationOptions validationOptions = new SignatureValidationOptions();
    validationOptions.ValidationFlags = ~ValidationFlags.ValidateSignatureCertificate & ~ValidationFlags.ValidateTimestampCertificate;
    validationOptions.DecryptionPassword = "dxdemo";

    //Validate the signature:
    PackageSignatureValidation signatureValidation = validator.Validate(path, validationOptions);
    AnalyzeValidationResult(signatureValidation);
}

Inheritance

Object
SignatureValidationOptions
See Also