PdfSignatureOptions.DefaultHashAlgorithm Property
In This Article
Specifies the default hash algorithm to be used in PDF documents generated within the application.
Namespace: DevExpress.XtraPrinting
Assembly: DevExpress.Printing.v24.2.Core.dll
NuGet Package: DevExpress.Printing.Core
#Declaration
public static PdfHashAlgorithm DefaultHashAlgorithm { get; set; }
#Property Value
Type | Description |
---|---|
Pdf |
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 Default |
---|---|
Pdf |
|
#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