Namespace PdfEngine.Vector.Security
Classes
- PdfEncryptionOptions
How to protect a copy. Passwords are prepared (SASLprep for AES-256) and never stored beyond the write.
- PdfEncryptor
Protect with a password and Remove Security: a full rewrite of the document, every object read through the source's security handler (object-stream members as ordinary objects), then encrypted per object with a new Standard security handler (Algorithm 1, AES-256 R6 or AES-128 R4) or written in clear. The cross-reference table is written fresh, with a new /ID. Security is only ever changed with the owner password: the author's permissions are not stripped by anyone who merely knows the open password.
- PdfPasswordPreparation
Password preparation for the AES-256 Standard security handler (ISO 32000-2 7.6.4.3.3): the SASLprep profile (RFC 4013) of stringprep (RFC 3454), then UTF-8, truncated to 127 bytes. Mapping (table B.1 to nothing, C.1.2 to a space), NFKC, the prohibited tables (C.1.2, C.2.1, C.2.2, C.3 to C.9) and the bidirectional rule (6) are applied. Two approximations: table D.2 (left-to-right characters) is taken as every letter or spacing mark that is not right-to-left, and "unassigned" means unassigned in the runtime's Unicode version rather than Unicode 3.2.
- PdfPermissionSet
What a reader who opens the document with the user password may do (ISO 32000-2 Table 22).
- PdfPublicKeySecurityHandler
The public-key security handler (ISO 32000-2 7.6.5, /Filter /Adobe.PubSec, sub-filters adbe.pkcs7.s3, s4 and s5): each recipient's CMS envelope holds a 20-byte seed and the recipient's permissions; the file key is SHA-1 (SHA-256 for AES-256) of the seed, every /Recipients entry and — with /EncryptMetadata false — four 0xFF bytes.
- PdfSecurityHandler
What every security handler shares once it has a file key (ISO 32000-2 7.6): the crypt filters (/CF, /StmF, /StrF, per-stream /Crypt), /EncryptMetadata, per-object keys (Algorithm 1) and RC4 / AES-CBC decryption of strings and streams. Subclasses authenticate and derive the key.
- PdfSecurityRewriteResult
A rewritten document and the number of signatures the rewrite invalidated.
- PdfStandardSecurityHandler
The Standard security handler (ISO 32000-2 7.6.4): revisions 2–4 (RC4 40–128 bit and AES-128 via crypt filters) and 5–6 (AES-256). Authenticates the user or owner password, derives the file key, and decrypts strings and streams per object (Algorithm 1), honouring /StmF, /StrF, named stream crypt filters, /EncryptMetadata and the exemption of cross-reference streams.
Enums
- PdfEncryptionStrength
The cipher a protected copy is written with. RC4 is deliberately not offered.