Sample code for 30+ languages & platforms
JavaScript

Example: Crypt2.LastSignerCert method

Demonstrates how to call the LastSignerCert method.
Note
This example is intended for running within a Chilkat.Js embedded JavaScript engine. All Chilkat JavaScript examples require Chilkat v11.4.0 or greater.
JavaScript
var success = false;

var crypt = new CkCrypt2();

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

success = crypt.VerifyP7M(p7m_path,out_path);
if (success == false) {
    console.log(crypt.LastErrorText);
    return;
}

// Examine the certificate(s) used for signing.
var numSigners = crypt.NumSignerCerts;
var i = 0;

var cert = new CkCert();

while (i < numSigners) {
    crypt.LastSignerCert(i,cert);
    console.log("Signer: " + cert.SubjectDN);
    i = i+1;
}