Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PdfPublicKeyEncryptionOptions

OfficeIMO.Pdf

Namespace
OfficeIMO.Pdf
Assembly
OfficeIMO.Pdf
Source revision
ba882f6b0d07 with working tree changes
Modifiers
sealed

Encrypts a PDF for certificate recipients with the public-key security handler (/Filter /Adobe.PubSec, /SubFilter /adbe.pkcs7.s5, AES-256). Each recipient opens the file with its private key; no password exists.

Inheritance

  • object
  • PdfPublicKeyEncryptionOptions

Remarks

The security provider creates the CMS EnvelopedData that carries the file key seed and permissions to every recipient. Certificates and the provider are not exposed as public properties, so option snapshots never copy certificate material.

Usage

Explore 1 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.

Accepted by parameters 1

Constructors

PdfPublicKeyEncryptionOptions 2 overloads
public PdfPublicKeyEncryptionOptions(IOfficeSecurityProvider securityProvider, IEnumerable<X509Certificate2> recipientCertificates) #

Creates public-key encryption options for one or more recipient certificates.

Parameters

securityProvider OfficeIMO.Security.IOfficeSecurityProvider required
Provider that creates CMS EnvelopedData, for example OfficeSecurityProvider from OfficeIMO.Security.
recipientCertificates System.Collections.Generic.IEnumerable<System.Security.Cryptography.X509Certificates.X509Certificate2> required
Recipient certificates. Only their public keys are used.
public PdfPublicKeyEncryptionOptions(IOfficeSecurityProvider securityProvider, X509Certificate2 recipientCertificate) #

Creates public-key encryption options for one recipient certificate.

Parameters

securityProvider OfficeIMO.Security.IOfficeSecurityProvider required
recipientCertificate System.Security.Cryptography.X509Certificates.X509Certificate2 required

Properties

public int RecipientCount { get; } #

Number of recipient certificates the document is encrypted to.

public PdfStandardPermissions AllowedPermissions { get; set; } #

Operations every recipient may perform. Defaults to all standard operations.

public bool EncryptMetadata { get; set; } #

Whether document metadata streams are encrypted. Defaults to true.

public IOfficeAesCryptographyProvider? AesCryptographyProvider { get; set; } #

Optional synchronous AES provider used when the host does not expose platform AES-CBC, such as browser WebAssembly.