Sample code for 30+ languages & platforms
PHP Extension

Example: Crypt2.LastSignerCert method

Demonstrates how to call the LastSignerCert method.

Chilkat PHP Extension Downloads

PHP Extension
<?php

include("chilkat.php");

$success = false;

$crypt = new CkCrypt2();

$p7m_path = 'qa_data/p7m/Firma.docx.p7m';
$out_path = 'qa_output/Firma.docx';

$success = $crypt->VerifyP7M($p7m_path,$out_path);
if ($success == false) {
    print $crypt->lastErrorText() . "\n";
    exit;
}

// Examine the certificate(s) used for signing.
$numSigners = $crypt->get_NumSignerCerts();
$i = 0;

$cert = new CkCert();

while ($i < $numSigners) {
    $crypt->LastSignerCert($i,$cert);
    print 'Signer: ' . $cert->subjectDN() . "\n";
    $i = $i + 1;
}


?>