LtvSigner
in package
Add LTV (Long-Term Validation) data to signed PDFs — PAdES B-LT profile.
Extracts certificates from existing signatures, fetches OCSP responses and CRLs, and embeds them in a DSS (Document Security Store) via an incremental update that preserves the original signatures.
Supports both online fetching (via OcspClient/CrlClient) and offline mode (pre-loaded OCSP/CRL data for testing).
Usage: LtvSigner::openString($signedPdfBytes) ->setOcspClient(new OcspClient()) ->setCrlClient(new CrlClient()) ->save('ltv-enabled.pdf');
// Offline / testing: LtvSigner::openString($signedPdfBytes) ->addOcspResponse($derOcspBytes) ->addCertificate($derCaCert) ->save('ltv-enabled.pdf');
Table of Contents
Methods
- addCertificate() : self
- Add an extra DER-encoded certificate to include in the DSS.
- addCrl() : self
- Pre-load a DER-encoded CRL (for offline/testing use).
- addOcspResponse() : self
- Pre-load a DER-encoded OCSP response (for offline/testing use).
- forSignature() : self
- Target a specific signature field by name. Can be called multiple times.
- getPageCount() : int
- getReader() : PdfReader
- getVersionWarnings() : array<int, string>
- getWarnings() : array<int, string>
- Get non-fatal warnings from OCSP/CRL fetching.
- open() : self
- openString() : self
- save() : void
- setCrlClient() : self
- Set the CRL client for online revocation checking.
- setOcspClient() : self
- Set the OCSP client for online revocation checking.
- toBytes() : string
Methods
addCertificate()
Add an extra DER-encoded certificate to include in the DSS.
public
addCertificate(string $derCert) : self
Parameters
- $derCert : string
Return values
selfaddCrl()
Pre-load a DER-encoded CRL (for offline/testing use).
public
addCrl(string $derCrl) : self
Parameters
- $derCrl : string
Return values
selfaddOcspResponse()
Pre-load a DER-encoded OCSP response (for offline/testing use).
public
addOcspResponse(string $derOcsp) : self
Parameters
- $derOcsp : string
Return values
selfforSignature()
Target a specific signature field by name. Can be called multiple times.
public
forSignature(string $fieldName) : self
If never called, all signatures are processed.
Parameters
- $fieldName : string
Tags
Return values
selfgetPageCount()
public
getPageCount() : int
Return values
intgetReader()
public
getReader() : PdfReader
Return values
PdfReadergetVersionWarnings()
public
getVersionWarnings() : array<int, string>
Return values
array<int, string>getWarnings()
Get non-fatal warnings from OCSP/CRL fetching.
public
getWarnings() : array<int, string>
Return values
array<int, string>open()
public
static open(string $path[, string $password = '' ]) : self
Parameters
- $path : string
- $password : string = ''
Return values
selfopenString()
public
static openString(string $pdfBytes[, string $password = '' ]) : self
Parameters
- $pdfBytes : string
- $password : string = ''
Return values
selfsave()
public
save(string $path) : void
Parameters
- $path : string
setCrlClient()
Set the CRL client for online revocation checking.
public
setCrlClient(CrlClient $client) : self
Parameters
- $client : CrlClient
Return values
selfsetOcspClient()
Set the OCSP client for online revocation checking.
public
setOcspClient(OcspClient $client) : self
Parameters
- $client : OcspClient
Return values
selftoBytes()
public
toBytes() : string