Sample code for 30+ languages & platforms
Node.js

Example: Crypt2.LastSignerCert method

Demonstrates how to call the LastSignerCert method.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

    var crypt = new chilkat.Crypt2();

    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 chilkat.Cert();

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


}

chilkatExample();