Sample code for 30+ languages & platforms
Node.js

Example: Crypt2.SetSigningCert method

Demonstrates how to call the SetSigningCert method.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

    //  Signing certificates can be obtained from many different sources..

    //  Load from a PFX
    var cryptA = new chilkat.Crypt2();
    var certA = new chilkat.Cert();
    success = certA.LoadPfxFile("c:/someDir/pfx_files/a.pfx","pfx_file_password");
    success = cryptA.SetSigningCert(certA);
    //  ...

    //  Load from a smart card or USB token.
    var cryptB = new chilkat.Crypt2();
    var certB = new chilkat.Cert();
    certB.SmartCardPin = "123456";
    success = certB.LoadFromSmartcard("");
    success = cryptB.SetSigningCert(certB);
    //  ...

    //  Load from a the Windows certificate store or macOS keychain
    var cryptC = new chilkat.Crypt2();
    var certC = new chilkat.Cert();
    success = certC.LoadByCommonName("Xyz 123");
    success = cryptC.SetSigningCert(certC);
    //  ...

}

chilkatExample();