I am currently grappling with unraveling the connection between C++ dlls and JavaScript. There is a snippet of js code that reads:
cert = CERT_FindUserCertByUsage(certDB, certName.nickname,certUsageEmailSigner, true, null);
where the variable cert is initialized as
let cert = null;
However, in the realm of C++, cert represents a structured data type known as CERTCertificateStr:
CERTCertificateStr {
char *subjectName;
char *issuerName;
SECItem derCert; /* original DER for the cert */
.... }
My quest now is to access the subject name in Javascript, so I proceeded with the line:
let a = cert.contents.subjectName;
Unfortunately, this results in an error stating "cannot get content of undefined size."
Is there anything crucial that I might be overlooking in translating from C++ to Javascript? And how can I successfully retrieve and display the subjectName in my Javascript code?