Skip to content

Commit

Permalink
Update example_052.php
Browse files Browse the repository at this point in the history
  • Loading branch information
hidasw committed Apr 24, 2024
1 parent 959052d commit 9950510
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions examples/example_052.php
Expand Up @@ -77,8 +77,8 @@

// set certificate file
$certificate = file_get_contents("data/cert/PDF User.pem");
$ca = "data/cert/Root CA Test.crt";
$extracerts = getcwd()."/$ca";
$issuer = "data/cert/Root CA Test.crt";
$extracerts = file_get_contents($issuer);
$crl = "data/cert/RootCATest.der.crl";

// set additional information
Expand All @@ -89,18 +89,19 @@
'ContactInfo' => 'http://www.tcpdf.org',
);

// set LTV setLtv($ocspURI=null, $crlURIorFILE=null, $issuerURIorFILE=null)
// set null to skip ocsp or crl
// set to empty or false will continue lookup in certificate attributes (Authority Info Access(AIA) and CRL Distribution Points(CDP))
// set LTV setLtv($ocspURI=false, $crlURIorFILE=false, $issuerURIorFILE=false)
// set false to skip ocsp or crl
// set to empty or null will continue lookup in certificate attributes (Authority Info Access(AIA) and CRL Distribution Points(CDP))
// skip both will result no LTV. Note that issuerURIorFILE cannot skipped. It will use given address/file location or lookup in cert AIA attributes if null.
// dont give any parameter to lookup all address in cert attributes.
$pdf->setLtv(null, $crl, $ca);
$pdf->setLtv();

// Set TSA server address
$pdf->setTimeStamp('http://timestamp.apple.com/ts01');

// set document signature
$pdf->setSignature($certificate, $certificate, 'tcpdfdemo', $extracerts, 2, $info);
// added digest algorithm in last arguments
$pdf->setSignature($certificate, $certificate, 'tcpdfdemo', $extracerts, 2, $info, 'sha256');

// set font. 'helvetica' MUST be used to avoid a PHP notice from PHP 7.4+
$pdf->setFont('helvetica', '', 12);
Expand Down

0 comments on commit 9950510

Please sign in to comment.