# PdfStandardEncryptionOptions

Options for generated PDF Standard password security.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[PdfStandardEncryptionOptions.cs:12](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfStandardEncryptionOptions.cs#L12)

**Modifiers**

sealed

Options for generated PDF Standard password security.

## Inheritance

- object
- PdfStandardEncryptionOptions

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Encrypt, Decrypt, and Sign PDFs](/docs/pdf/encrypt-sign/) Guide
  
  Encrypt PDFs with passwords and permissions, decrypt protected files, sign with a certificate and validate signatures with OfficeIMO.Pdf.
- [PDF Security and Digital Signatures](/docs/pdf/security/) Guide
  
  Encrypt PDFs, inspect signature structure, verify CMS signatures, preserve signed revisions, and enrich long-term validation evidence.
- [Protect a PDF with AES-256 passwords](/pdf/protect/) Guide
  
  Encrypt a PDF with AES-256 Standard security, set document-open and owner passwords, and review preservation evidence for the protected copy.

## Usage

Explore 7 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 4

- Property [PdfCreateOptions.Encryption](/api/pdf/officeimo-pdf-pdfcreateoptions/#property-encryption)
- Property [PdfSaveOptions.Encryption](/api/pdf/officeimo-pdf-pdfsaveoptions/#property-encryption)
- Method [PdfStandardEncryptionOptions.Clone](/api/pdf/officeimo-pdf-pdfstandardencryptionoptions/#method-clone)
- Method [PdfStandardEncryptionOptions.ForPermissions](/api/pdf/officeimo-pdf-pdfstandardencryptionoptions/#method-forpermissions-string-officeimo-pdf-pdfstandardpermissions)

### Accepted by parameters 3

- Method [PdfCreateOptions.SetEncryption](/api/pdf/officeimo-pdf-pdfcreateoptions/#method-setencryption-officeimo-pdf-pdfstandardencryptionoptions) parameter `encryption`
- Method [PdfDocumentSecurity.Encrypt](/api/pdf/officeimo-pdf-pdfdocumentsecurity/#method-encrypt-officeimo-pdf-pdfstandardencryptionoptions) parameter `encryption`
- Method [PdfDocumentSecurity.Reencrypt](/api/pdf/officeimo-pdf-pdfdocumentsecurity/#method-reencrypt-string-officeimo-pdf-pdfstandardencryptionoptions) parameter `newEncryption`

Filter members 

Show inherited

## Constructors

`public PdfStandardEncryptionOptions(string userPassword)` [#](#constructor-ctor-string)

[PdfStandardEncryptionOptions.cs:12](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfStandardEncryptionOptions.cs#L12)

Creates Standard security options using the supplied document-open password.

Parameters

**userPassword string required**

## Methods

`public PdfStandardEncryptionOptions Clone()` [#](#method-clone)

[PdfStandardEncryptionOptions.cs:112](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfStandardEncryptionOptions.cs#L112)

Creates a deep copy of the encryption options.

Returns

`PdfStandardEncryptionOptions`

`public static PdfStandardEncryptionOptions ForPermissions(string ownerPassword, PdfStandardPermissions allowedPermissions)` [#](#method-forpermissions-string-officeimo-pdf-pdfstandardpermissions)

[PdfStandardEncryptionOptions.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfStandardEncryptionOptions.cs#L29)

Creates permissions-only security: readers can open without a password, while changing restrictions requires the supplied owner password.

Parameters

**ownerPassword string required**

Non-empty password authorizing permission changes.

**allowedPermissions OfficeIMO.Pdf.PdfStandardPermissions required**

Operations permitted to readers without the owner password.

Returns

`PdfStandardEncryptionOptions` Explicit permissions-only encryption options using AES-256 by default.

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public string UserPassword { get; set; }` [#](#property-userpassword)

[PdfStandardEncryptionOptions.cs:38](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfStandardEncryptionOptions.cs#L38)

Password required to open the generated PDF, or empty for options created by [PdfStandardEncryptionOptions.ForPermissions](/api/pdf/officeimo-pdf-pdfstandardencryptionoptions/). AES-256 accepts at most 4096 UTF-16 characters before normalization.

`public string? OwnerPassword { get; set; }` [#](#property-ownerpassword)

[PdfStandardEncryptionOptions.cs:47](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfStandardEncryptionOptions.cs#L47)

Optional owner password. When omitted, the user password is reused. AES-256 accepts at most 4096 UTF-16 characters before normalization.

`public bool HasDistinctOwnerPassword { get; }` [#](#property-hasdistinctownerpassword)

[PdfStandardEncryptionOptions.cs:61](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfStandardEncryptionOptions.cs#L61)

Whether the owner password differs from the open password after the selected PDF algorithm's normalization and byte limit. False means an open-password holder also has owner access.

`public PdfStandardEncryptionAlgorithm Algorithm { get; set; }` [#](#property-algorithm)

[PdfStandardEncryptionOptions.cs:65](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfStandardEncryptionOptions.cs#L65)

Encryption algorithm. AES-256 revision 6 is the default; RC4 requires explicit legacy selection.

`public bool EncryptMetadata { get; set; }` [#](#property-encryptmetadata)

[PdfStandardEncryptionOptions.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfStandardEncryptionOptions.cs#L68)

Whether document metadata streams are encrypted. Defaults to true.

`public IOfficeAesCryptographyProvider? AesCryptographyProvider { get; set; }` [#](#property-aescryptographyprovider)

[PdfStandardEncryptionOptions.cs:74](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfStandardEncryptionOptions.cs#L74)

Optional synchronous AES provider used when the host does not expose platform AES-CBC, such as browser WebAssembly. Native platform cryptography remains the default when this property is null.

`public int Permissions { get; set; }` [#](#property-permissions)

[PdfStandardEncryptionOptions.cs:78](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfStandardEncryptionOptions.cs#L78)

Raw PDF Standard security permission bit mask. Defaults to allowing all standard operations.

`public PdfStandardPermissions AllowedPermissions { get; set; }` [#](#property-allowedpermissions)

[PdfStandardEncryptionOptions.cs:84](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfStandardEncryptionOptions.cs#L84)

Typed view over the Standard security permission mask.

## Fields

`public const int AllowAllPermissions` [#](#field-allowallpermissions)

[PdfStandardEncryptionOptions.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfStandardEncryptionOptions.cs#L10)

PDF permission bit mask allowing all standard operations.

Value: `-4`

<!-- PowerForge markdown artifact sha256:4F4C83EFFF96BFEA481CFA23FC00E4B437D7898CEEE592F59135F1A4E65CB36C -->
