PdfSignatureOptions.HashAlgorithm Property
Specifies the hash algorithm to be used in a PDF document.
Namespace: DevExpress.XtraPrinting
Assembly: DevExpress.Printing.v26.1.Core.dll
NuGet Package: DevExpress.Printing.Core
Declaration
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 | SHA256 hashing algorithm. |
| SHA384 | SHA384 hashing algorithm. |
| SHA512 | SHA512 hashing algorithm. |
Property Paths
You can access this nested property as listed below:
| Object Type | Path to HashAlgorithm |
|---|---|
| PdfExportOptions |
|
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