diff --git a/examples/example_052.php b/examples/example_052.php index 9c07b23d..778c658d 100644 --- a/examples/example_052.php +++ b/examples/example_052.php @@ -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 @@ -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);