PDFEncryptionDict

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

NameTypeAccessDescription
filterStringReadFilter name — must be “Standard” for standard handler.
vintReadV: algorithm version (0-5).
rintReadR: security handler revision (2-6).
lengthintReadKey length in bits (40-256).
keyLengthintReadKey length in bytes.
obyte[]ReadO: owner password hash.
ubyte[]ReadU: user password hash.
oEbyte[]ReadOE: owner encryption key (R=6, 32 bytes).
uEbyte[]ReadUE: user encryption key (R=6, 32 bytes).
permsbyte[]ReadPerms: encrypted permissions (R=6, 16 bytes).
pintReadP: permission flags as a signed 32-bit integer.
encryptMetadatabooleanReadEncryptMetadata: default true.
stmFStringReadStmF: crypt filter for streams (V=4+).
strFStringReadStrF: crypt filter for strings (V=4+).
cFCOSDictionaryReadCF: crypt filter dictionary (V=4+).
cipherTypeCipherTypeReadDetermines the cipher type based on V and crypt filters.
cOSDictionaryCOSDictionaryReadReturns the underlying dictionary.

Methods

SignatureDescription
PDFEncryptionDict(dict: COSDictionary)Creates an encryption dictionary wrapper.
getFilter()StringFilter name — must be “Standard” for standard handler.
getV()intV: algorithm version (0-5).
getR()intR: security handler revision (2-6).
getLength()intKey length in bits (40-256).
getKeyLength()intKey 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()intP: permission flags as a signed 32-bit integer.
getEncryptMetadata()booleanEncryptMetadata: default true.
getStmF()StringStmF: crypt filter for streams (V=4+).
getStrF()StringStrF: crypt filter for strings (V=4+).
getCF()COSDictionaryCF: crypt filter dictionary (V=4+).
getCipherType()CipherTypeDetermines the cipher type based on V and crypt filters.
build(algorithm: CryptoAlgorithm, permissions: int, O: byte[], U: byte[], OE: byte[], UE: byte[], Perms: byte[])PDFEncryptionDictBuilds a new /Encrypt dictionary for the given algorithm and parameters.
getCOSDictionary()COSDictionaryReturns the underlying dictionary.

See Also