Skip to main content
All docs
V25.1
  • PdfSignatureOptions.DefaultHashAlgorithm Property

    Specifies the default hash algorithm to be used in PDF documents generated within the application.

    Namespace: DevExpress.XtraPrinting

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

    NuGet Package: DevExpress.Printing.Core

    Declaration

    public static PdfHashAlgorithm DefaultHashAlgorithm { get; set; }

    Property Value

    Type Description
    PdfHashAlgorithm

    The default hash algorithm to be used in PDF documents generated within the application.

    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 DefaultHashAlgorithm
    PdfExportOptions
    .SignatureOptions .DefaultHashAlgorithm

    Remarks

    Important

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

    The code sample below shows how to specify the default hash algorithm for PDF export files to SHA-512.

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