Sample code for 30+ languages & platforms
Perl

Example: Crypt2.LastSignerCert method

Demonstrates how to call the LastSignerCert method.

Chilkat Perl Downloads

Perl
use chilkat();

$success = 0;

$crypt = chilkat::CkCrypt2->new();

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

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

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

$cert = chilkat::CkCert->new();

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