Compute extends Data
Com\Tecnick\Pdf\Encrypt\Compute
PHP class to generate encryption data
Tags
Table of Contents
- $encmap : array<string|int, mixed>
- Define a list of available encrypt encoders.
- $encpad : string
- Encryption padding string.
- $encrypt_settings : array<string|int, mixed>
- Encryption settings
- $permbits : array<string|int, mixed>
- Map permission modes and bits
- getPdfEncryptionObj() : mixed
- Get the PDF encryption block
- generateEncryptionKey() : mixed
- Compute encryption key
- generatePublicEncryptionKey() : mixed
- Compute public encryption key
- generateStandardEncryptionKey() : mixed
- Compute standard encryption key
- getAdditionalEncDic() : string
- get additional encryption dictionary entries for the standard security handler
- getBooleanString() : string
- Return a string representation of a boolean value
- getCryptFilter() : string
- Get Crypt Filter section
- getOEValue() : string
- Compute OE value
- getOValue() : string
- Compute O value
- getUEValue() : string
- Compute UE value
- getUvalue() : string
- Compute U value
- setMissingValues() : mixed
- Set missing values
Properties
$encmap
Define a list of available encrypt encoders.
protected static array<string|int,
mixed> $encmap = array( 0 =>
'RCFourFive', // RC4-40 1 => 'RCFourSixteen', // RC4-128 2 =>
'AESSixteen', // AES-128 3 => 'AESThirtytwo', // AES-256 'RC4'
=> 'RCFour', // RC4-40 'RC4-40' => 'RCFourFive', // RC4-40
'RC4-128' => 'RCFourSixteen', // RC4-128 'AES' => 'AES', //
AES-256 'AES-128' => 'AESSixteen', // AES-128 'AES-256' =>
'AESThirtytwo', // AES-256 'AESnopad' => 'AESnopad', // AES - no
padding 'MD5-16' => 'MDFiveSixteen', // MD5-16 'seed' =>
'Seed', )
$encpad
Encryption padding string.
protected static string $encpad = "(�N^Nu�AdNV��..��h>�/��dSiz"
$encrypt_settings
Encryption settings
protected static array<string|int,
mixed> $encrypt_settings =
array(0 =>
array( // RC4 40 bit 'V' => 1, 'Length' => 40, 'CF' =>
array('CFM' => 'V2', 'AuthEvent' => 'DocOpen'), ), 1 =>
array( // RC4 128 bit 'V' => 2, 'Length' => 128, 'CF' =>
array('CFM' => 'V2', 'AuthEvent' => 'DocOpen'), 'SubFilter'
=> 'adbe.pkcs7.s4', 'Recipients' => array(), ), 2 =>
array( // AES 128 bit 'V' => 4, 'Length' => 128, 'CF' =>
array('CFM' => 'AESV2', 'Length' => 128, 'AuthEvent' =>
'DocOpen'), 'SubFilter' => 'adbe.pkcs7.s5', 'Recipients' =>
array(), ), 3 => array( // AES 256 bit 'V' => 5, 'Length'
=> 256, 'CF' => array('CFM' => 'AESV3', 'Length' =>
256, 'AuthEvent' => 'DocOpen'), 'SubFilter' =>
'adbe.pkcs7.s5', 'Recipients' => array(), ))
$permbits
Map permission modes and bits
protected static array<string|int,
mixed> $permbits = array( 'owner' => 2, //
bit 2 -- inverted logic: cleared by default // When set permits
change of encryption and enables all other permissions. 'print'
=> 4, // bit 3 // Print the document. 'modify' => 8, // bit 4
// Modify the contents of the document by operations other than
those controlled // by 'fill-forms', 'extract' and 'assemble'.
'copy' => 16, // bit 5 // Copy or otherwise extract text and
graphics from the document. 'annot-forms' => 32, // bit 6 // Add
or modify text annotations, fill in interactive form fields, and,
// if 'modify' is also set, create or modify interactive form
fields // (including signature fields). 'fill-forms' => 256, //
bit 9 // Fill in existing interactive form fields (including
signature fields), // even if 'annot-forms' is not specified.
'extract' => 512, // bit 10 // Extract text and graphics (in
support of accessibility to users with // disabilities or for other
purposes). 'assemble' => 1024, // bit 11 // Assemble the
document (insert, rotate, or delete pages and create bookmarks //
or thumbnail images), even if 'modify' is not set. 'print-high'
=> 2048, )
Methods
getPdfEncryptionObj()
Get the PDF encryption block
public getPdfEncryptionObj(int &$pon)
: mixed
Parameters
- $pon : int
-
Current PDF object number
return string
Return values
mixed —generateEncryptionKey()
Compute encryption key
protected generateEncryptionKey()
: mixed
Return values
mixed —generatePublicEncryptionKey()
Compute public encryption key
protected generatePublicEncryptionKey()
: mixed
Return values
mixed —generateStandardEncryptionKey()
Compute standard encryption key
protected generateStandardEncryptionKey()
: mixed
Return values
mixed —getAdditionalEncDic()
get additional encryption dictionary entries for the standard security handler
protected getAdditionalEncDic()
: string
Return values
string —getBooleanString()
Return a string representation of a boolean value
protected getBooleanString(bool $value)
: string
Parameters
- $value : bool
-
Value to convert
Return values
string —getCryptFilter()
Get Crypt Filter section
protected getCryptFilter()
: string
A dictionary whose keys shall be crypt filter names and whose values shall be the corresponding crypt filter dictionaries.
Return values
string —getOEValue()
Compute OE value
protected getOEValue()
: string
Return values
string —OE value
getOValue()
Compute O value
protected getOValue()
: string
Return values
string —O value
getUEValue()
Compute UE value
protected getUEValue()
: string
Return values
string —UE value
getUvalue()
Compute U value
protected getUvalue()
: string
Return values
string —U value
setMissingValues()
Set missing values
protected setMissingValues()
: mixed