Node.js
Node.js
Transition from Email.GetSignedByCertChain to Email.LastSignerCert
Provides instructions for replacing deprecated GetSignedByCertChain method calls with LastSignerCert.Chilkat Node.js Downloads
NODEJS_PRELUDE
function chilkatExample() {
var success = false;
var email = new chilkat.Email();
// ...
// ...
// ------------------------------------------------------------------------
// The GetSignedByCertChain method is deprecated:
// certChainObj: CertChain
var certChainObj = email.GetSignedByCertChain();
if (email.LastMethodSuccess == false) {
console.log(email.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using LastSignerCert to get the signing certificate,
// then build the cert chain from the signing certificate object.
var signerCert = new chilkat.Cert();
success = email.LastSignerCert(0,signerCert);
if (success == false) {
console.log(email.LastErrorText);
return;
}
// Get the certificate chain from the signer certificate.
var certChain = new chilkat.CertChain();
success = signerCert.BuildCertChain(certChain);
if (success == false) {
console.log(signerCert.LastErrorText);
return;
}
}
chilkatExample();