phpdftk API Documentation

DssBuilder
in package

FinalYes

Builder for the Document Security Store (DSS) — ISO 32000-2 §12.8.4.3.

Registers certificate, OCSP response, and CRL streams as indirect objects via an IncrementalWriter, builds VRI (Validation Related Information) entries keyed by signature hash, and produces a populated DSS.

Deduplicates identical data by SHA-256 hash.

Table of Contents

Methods

__construct()  : mixed
addCertificate()  : PdfReference
Add a DER-encoded certificate to the DSS.
addCrl()  : PdfReference
Add a DER-encoded CRL to the DSS.
addOcspResponse()  : PdfReference
Add a DER-encoded OCSP response to the DSS.
addVriEntry()  : void
Add a VRI (Validation Related Information) entry for a signature.
build()  : DSS
Build the populated DSS object and register it with the writer.
computeVriKey()  : string
Compute the VRI dictionary key for a signature.

Methods

addCertificate()

Add a DER-encoded certificate to the DSS.

public addCertificate(string $derCert) : PdfReference

Creates a PdfStream indirect object and registers it with the writer. Deduplicates: identical certificates (by SHA-256) return the same reference.

Parameters
$derCert : string
Return values
PdfReference

addOcspResponse()

Add a DER-encoded OCSP response to the DSS.

public addOcspResponse(string $derOcsp) : PdfReference
Parameters
$derOcsp : string
Return values
PdfReference

addVriEntry()

Add a VRI (Validation Related Information) entry for a signature.

public addVriEntry(string $sigContentsHash[, array<int, PdfReference$certRefs = [] ][, array<int, PdfReference$ocspRefs = [] ][, array<int, PdfReference$crlRefs = [] ]) : void
Parameters
$sigContentsHash : string

Uppercase hex SHA-256 of the raw signature bytes (hex-decoded /Contents value)

$certRefs : array<int, PdfReference> = []

References to certificate streams

$ocspRefs : array<int, PdfReference> = []

References to OCSP response streams

$crlRefs : array<int, PdfReference> = []

References to CRL streams

build()

Build the populated DSS object and register it with the writer.

public build() : DSS
Return values
DSS

computeVriKey()

Compute the VRI dictionary key for a signature.

public static computeVriKey(string $rawSignatureBytes) : string
Parameters
$rawSignatureBytes : string

The raw DER bytes of the signature (hex-decoded /Contents value)

Return values
string

Uppercase hex SHA-256 hash


        
On this page

Search results