Skip to main content
All docs
V21.2

PdfSignatureOptions.HashAlgorithm Property

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

Namespace: DevExpress.XtraPrinting

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

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.

// Creates a simple report.
XtraReport report = new XtraReport()
{
    Name = "SimpleReport",
    Bands = {
        new DetailBand() {
            Controls = {
                new XRLabel() {
                    Text = "Simple Report"
                }
            }
        }
    }
};
// Specifies the hash algorithm.
report.ExportOptions.Pdf.SignatureOptions.HashAlgorithm = PdfHashAlgorithm.SHA512;
// Exports the report to the user's Downloads folder.
report.ExportToPdf(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
    + @"\Downloads\" + report.Name + ".pdf");
See Also