Skip to main content
A newer version of this page is available. .
All docs
V20.2

PdfSignatureOptions.HashAlgorithm Property

Specifies the hash algorithm to be used in a PDF document.

Namespace: DevExpress.XtraPrinting

Assembly: DevExpress.Printing.v20.2.Core.dll

NuGet Packages: DevExpress.Printing.Core, DevExpress.WindowsDesktop.Printing.Core

Declaration

public PdfHashAlgorithm HashAlgorithm { get; set; }

Property Value

Type Description
PdfHashAlgorithm

The hash algorithm to be used in a PDF document.

Available values:

Name Description
SHA1

Obsolete. This field is obsolete (do not use this value due to security reasons).

SHA256
SHA384
SHA512

Property Paths

You can access this nested property as listed below:

Object Type Path to HashAlgorithm
PdfExportOptions
.SignatureOptions .HashAlgorithm

Remarks

Important

For security reasons, do not set this property to SHA-1.

The code sample below shows how to set a PDF export file’s hash algorithm to SHA-512.

using DevExpress.XtraReports.UI;
using DevExpress.XtraPrinting;
// ...
// Create a simple report.
XtraReport report = new XtraReport() {
  Name = "SimpleReport",
    Bands = {
      new DetailBand() {
        Controls = {
          new XRLabel() {
            Text = "Simple Report"
          }
        }
      }
    }
  }
};
// Use the SHA-512 hash algorithm.
report.ExportOptions.Pdf.SignatureOptions.HashAlgorithm = PdfHashAlgorithm.SHA512;
// Export the report to the user's Downloads folder.
report.ExportToPdf(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Downloads\" + report.Name + ".pdf");
See Also