Sample code for 30+ languages & platforms
Node.js

Transition from Cert.ExportPublicKey to Cert.GetPublicKey

Provides instructions for replacing deprecated ExportPublicKey method calls with GetPublicKey.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

    var cert = new chilkat.Cert();

    //  ------------------------------------------------------------------------
    //  The ExportPublicKey method is deprecated:

    // publickeyObj: PublicKey
    var publickeyObj = cert.ExportPublicKey();
    if (cert.LastMethodSuccess == false) {
        console.log(cert.LastErrorText);
        return;
    }

    //  ...
    //  ...

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

    var publickeyOut = new chilkat.PublicKey();
    success = cert.GetPublicKey(publickeyOut);
    if (success == false) {
        console.log(cert.LastErrorText);
        return;
    }


}

chilkatExample();