PDFEncryptionDict
Overview
PDFEncryptionDict is a class in Aspose.Pdf FOSS for Java.
Wraps the /Encrypt dictionary from the PDF trailer (ISO 32000-1:2008, §7.6.1, Tables 20-21).
Properties
| Name | Type | Access | Description |
|---|---|---|---|
filter | String | Read | Filter name — must be “Standard” for standard handler. |
v | int | Read | V: algorithm version (0-5). |
r | int | Read | R: security handler revision (2-6). |
length | int | Read | Key length in bits (40-256). |
keyLength | int | Read | Key length in bytes. |
o | byte[] | Read | O: owner password hash. |
u | byte[] | Read | U: user password hash. |
oE | byte[] | Read | OE: owner encryption key (R=6, 32 bytes). |
uE | byte[] | Read | UE: user encryption key (R=6, 32 bytes). |
perms | byte[] | Read | Perms: encrypted permissions (R=6, 16 bytes). |
p | int | Read | P: permission flags as a signed 32-bit integer. |
encryptMetadata | boolean | Read | EncryptMetadata: default true. |
stmF | String | Read | StmF: crypt filter for streams (V=4+). |
strF | String | Read | StrF: crypt filter for strings (V=4+). |
cF | COSDictionary | Read | CF: crypt filter dictionary (V=4+). |
cipherType | CipherType | Read | Determines the cipher type based on V and crypt filters. |
cOSDictionary | COSDictionary | Read | Returns the underlying dictionary. |
Methods
| Signature | Description |
|---|---|
PDFEncryptionDict(dict: COSDictionary) | Creates an encryption dictionary wrapper. |
getFilter() → String | Filter name — must be “Standard” for standard handler. |
getV() → int | V: algorithm version (0-5). |
getR() → int | R: security handler revision (2-6). |
getLength() → int | Key length in bits (40-256). |
getKeyLength() → int | Key length in bytes. |
getO() → byte[] | O: owner password hash. |
getU() → byte[] | U: user password hash. |
getOE() → byte[] | OE: owner encryption key (R=6, 32 bytes). |
getUE() → byte[] | UE: user encryption key (R=6, 32 bytes). |
getPerms() → byte[] | Perms: encrypted permissions (R=6, 16 bytes). |
getP() → int | P: permission flags as a signed 32-bit integer. |
getEncryptMetadata() → boolean | EncryptMetadata: default true. |
getStmF() → String | StmF: crypt filter for streams (V=4+). |
getStrF() → String | StrF: crypt filter for strings (V=4+). |
getCF() → COSDictionary | CF: crypt filter dictionary (V=4+). |
getCipherType() → CipherType | Determines the cipher type based on V and crypt filters. |
build(algorithm: CryptoAlgorithm, permissions: int, O: byte[], U: byte[], OE: byte[], UE: byte[], Perms: byte[]) → PDFEncryptionDict | Builds a new /Encrypt dictionary for the given algorithm and parameters. |
getCOSDictionary() → COSDictionary | Returns the underlying dictionary. |