Skip to main content
All docs
V25.1
  • SignatureOptions.Certificate Property

    Gets or sets the X.509 signature certificate.

    Namespace: DevExpress.Docs.Pdf

    Assembly: DevExpress.Docs.Core.v25.1.dll

    NuGet Package: DevExpress.Docs.Core

    Declaration

    public X509Certificate2 Certificate { get; set; }

    Property Value

    Type Description
    X509Certificate2

    The signature certificate.

    Property Paths

    You can access this nested property as listed below:

    Object Type Path to Certificate
    PdfExportOptions
    .SignatureOptions .Certificate

    Example

    The following code snippet signs the exported PDF file:

    using DevExpress.Docs.Presentation;
    using DevExpress.Docs.Presentation.Export;
    using System.Security.Cryptography.X509Certificates;
    //...
    using (var presentation = new Presentation(File.ReadAllBytes("C:\\Documents\\Presentation.pptx")))
    {
      var options = new PdfExportOptions();
      options.SignatureOptions.Certificate = new X509Certificate2(@"..\..\..\SignDemo.pfx", "dxdemo");
      options.SignatureOptions.HashAlgorithm = DevExpress.Docs.Pdf.HashAlgorithm.SHA256;
      options.SignatureOptions.ImageData = File.ReadAllBytes("..\\..\\..\\image.emf");
    
      options.SignatureOptions.Location = "USA";
      options.SignatureOptions.ContactInfo = "john.smith@example.com";
      options.SignatureOptions.Reason = "Approved";
    
      presentation.ExportToPdf(new FileStream("C:\\Documents\\Presentation.pdf", FileMode.Create, FileAccess.ReadWrite), options);
    }
    
    See Also