Class 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.
public static class PdfPasswordPreparation
- Inheritance
-
PdfPasswordPreparation
- Inherited Members
Fields
MaxBytes
ISO 32000-2 truncates the UTF-8 password to this many bytes.
public const int MaxBytes = 127
Field Value
Methods
PrepareForEncryption(string)
A password about to be stored in a new encryption dictionary. Unassigned code points are refused as well as prohibited ones (a "stored string" in RFC 3454 terms).
public static byte[] PrepareForEncryption(string password)
Parameters
passwordstring
Returns
- byte[]
Exceptions
- ArgumentException
The password contains a character SASLprep prohibits.