DssBuilder
in package
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
__construct()
public
__construct(IncrementalWriter $writer) : mixed
Parameters
- $writer : IncrementalWriter
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
PdfReferenceaddCrl()
Add a DER-encoded CRL to the DSS.
public
addCrl(string $derCrl) : PdfReference
Parameters
- $derCrl : string
Return values
PdfReferenceaddOcspResponse()
Add a DER-encoded OCSP response to the DSS.
public
addOcspResponse(string $derOcsp) : PdfReference
Parameters
- $derOcsp : string
Return values
PdfReferenceaddVriEntry()
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
DSScomputeVriKey()
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