Sample code for 30+ languages & platforms
Node.js

Transition from Email.GetEncryptedByCert to Email.LastDecryptCert

Provides instructions for replacing deprecated GetEncryptedByCert method calls with LastDecryptCert.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

    var email = new chilkat.Email();

    //  ...
    //  ...

    //  ------------------------------------------------------------------------
    //  The GetEncryptedByCert method is deprecated:

    // certObj: Cert
    var certObj = email.GetEncryptedByCert();
    if (email.LastMethodSuccess == false) {
        console.log(email.LastErrorText);
        return;
    }

    //  ...
    //  ...

    //  ------------------------------------------------------------------------
    //  Do the equivalent using LastDecryptCert.
    //  Your application creates a new, empty Cert object which is passed 
    //  in the last argument and filled upon success.

    var certOut = new chilkat.Cert();
    success = email.LastDecryptCert(certOut);
    if (success == false) {
        console.log(email.LastErrorText);
        return;
    }


}

chilkatExample();