Table of contents
Namespace: Com\Tecnick\Pdf\Sign\Output
final class Dss
Source: src/Output/Dss.php:49
Emits the Document Security Store (DSS) PDF objects for a signature: the certificate, OCSP, and CRL streams, a VRI entry, and the DSS dictionary. The object number is passed by reference and advanced, and the emitted object bodies are returned keyed by number. Stream encryption is delegated to an optional encryptor callable so the emitter does not depend on the host encryption object.
The VRI key is the uppercase base-16 SHA-1 digest of the signature Contents bytes, per ISO 32000-2 clause 12.8.4.3.
A DSS written by an incremental update replaces the one before it. Pass the previous state as $existing and its VRI entries and object references are merged into the new dictionary instead of being dropped. Material an earlier revision already wrote is referenced again rather than written a second time.
Methods
emit()
Emit the DSS objects for a signature’s validation material.
public emit(
array{certs: list<string>, ocsp: list<string>, crls: list<string>} $material,
string $signatureContents,
int &$pon,
callable|null $encryptor = null,
array{vri: array<string,int>, certs: list<int>, ocsp: list<int>, crls: list<int>, objects?: array<string,int>}|null $existing = null
): array{objects: array<int,string>, object_id: int, state: array{vri: array<string,int>, certs: list<int>, ocsp: list<int>, crls: list<int>, objects: array<string,int>}}
Parameters:
$material(array{certs: list<string>, ocsp: list<string>, crls: list<string>})$signatureContents(string): Signature /Contents bytes (hex-decoded, including any placeholder padding), hashed for the VRI key.$pon(int): Current object number; advanced by reference.$encryptor(callable|null): Optional fn(string $data, int $objectId): string.$existing(array{vri: array<string,int>, certs: list<int>, ocsp: list<int>, crls: list<int>, objects?: array<string,int>}|null): State returned by a previous emit() for the same document, carried forward into the new dictionary.
Returns: array{objects: array<int,string>, object_id: int, state: array{vri: array<string,int>, certs: list<int>, ocsp: list<int>, crls: list<int>, objects: array<string,int>}}: The emitted object bodies keyed by object number, the DSS dictionary object number (0 when there is nothing to emit), and the state to pass back as $existing on the next incremental update.
Throws:
- Exception: If the object number, the signature contents, the material, or the carried state is invalid, or the encryptor returns a non-string value.
Source: src/Output/Dss.php:74