Closed JackGarner closed 8 months ago
Hi everyone! I need to use CAdESCOM.CPSigner object This is how it works in VBS:
Set Certs = Store.Certificates.Find (CAPICOM_CERTIFICATE_FIND_SHA1_HASH, "e1938439a426039f5b159510e7cdf17b0b6fcaef") Set Cert = Certs.Item (1) Set Signer = CreateObject ("CADESCOM.CpSigner") Signer.Certificate = Cert
But when I do the same via winax let oSigner = new ActiveXObject("CAdESCOM.CPSigner");
let oSigner = new ActiveXObject("CAdESCOM.CPSigner");
oSigner.Certificate = cert;
console.log(oSigner.Certificate);
But if I set the Options property, it works:
oSigner.Options = 2; console.log(oSigner.Options); outputs 2.
I tried doing it this way: oSigner.__methods.Certificate = cert; This command works, but later the signature is not set correctly.
oSigner.__methods.Certificate = cert;
In the end I achieved the desired result thanks to the commands:
oCert = new winax.Variant(oStore.Certificates.Item(i), 'byref'); oSigner.Certificate = cert;
Can you tell me if I did it right or not? It seems to work, but for some reason I have doubts that I'm doing something wrong....
Thanks in advance!
Hi everyone! I need to use CAdESCOM.CPSigner object This is how it works in VBS:
But when I do the same via winax
let oSigner = new ActiveXObject("CAdESCOM.CPSigner");
oSigner.Certificate = cert;
- I get an error: Error: Error: DispPropertyPut: Certificateconsole.log(oSigner.Certificate);
- undefinedBut if I set the Options property, it works:
I tried doing it this way:
oSigner.__methods.Certificate = cert;
This command works, but later the signature is not set correctly.In the end I achieved the desired result thanks to the commands:
Can you tell me if I did it right or not? It seems to work, but for some reason I have doubts that I'm doing something wrong....
Thanks in advance!