Back to Devexpress

PdfEncryptionOptions.Algorithm Property

officefileapi-devexpress-dot-pdf-dot-pdfencryptionoptions-51364874.md

latest3.5 KB
Original Source

PdfEncryptionOptions.Algorithm Property

Specifies an algorithm to encrypt a PDF document.

Namespace : DevExpress.Pdf

Assembly : DevExpress.Pdf.v25.2.Core.dll

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public PdfEncryptionAlgorithm Algorithm { get; set; }
vb
Public Property Algorithm As PdfEncryptionAlgorithm

Property Value

TypeDescription
PdfEncryptionAlgorithm

A PdfEncryptionAlgorithm enumeration value that specifies an encryption algorithm.

|

Available values:

NameDescription
ARC4

Use the 128-bit ARC4 algorithm.

| | AES128 |

Use the 128-bit AES (Advanced Encryption Standard) algorithm.

| | AES256 |

Use the 256-bit AES (Advanced Encryption Standard) algorithm.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to Algorithm
PdfSaveOptions

.EncryptionOptions .Algorithm

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the Algorithm property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

pdf-document-api-protect-document-with-password/CS/PDFPasswordProtection/Program.cs#L25

csharp
// Specify the 256-bit AES encryption algorithm.
encryptionOptions.Algorithm = PdfEncryptionAlgorithm.AES256;

office-file-api-in-web-api-app/CS/Controllers/PdfController.cs#L78

csharp
encryptionOptions.UserPasswordString = password;
encryptionOptions.Algorithm = PdfEncryptionAlgorithm.AES256;
processor.SaveDocument(result, new PdfSaveOptions() { EncryptionOptions = encryptionOptions });

pdf-document-api-protect-document-with-password/VB/PDFPasswordProtection/Program.vb#L22

vb
' Specify the 256-bit AES encryption algorithm.
encryptionOptions.Algorithm = DevExpress.Pdf.PdfEncryptionAlgorithm.AES256
' Save the protected document with encryption settings.

See Also

PdfEncryptionOptions Class

PdfEncryptionOptions Members

DevExpress.Pdf Namespace