Open anushka-settlemint opened 5 months ago
A couple of things to try:
Otherwise please share the error.
Hi @kladd thanks for the reply. Step 2 helped me solve the issue.
Hi, I am facing another issue now. I am able to successfully sign a transaction but while recovering the public key from the signature, I am getting a different public key as compared to the original one. Any idea how I can solve this issue? I have also raised the same on stack exchange, Please refer for details https://ethereum.stackexchange.com/questions/164017/getting-random-public-key-address-from-cloudhsm-signature-in-nodejs
Hi @anushka-settlemint, glad to here you were able to get the sample working, and sorry to hear you're still facing issues. Since ecrecover is outside the scope of these samples I can't be of much help here. On the topic of the sample, and maybe relevant to your issue, is that the sample always uses a 256 byte buffer to store the signature and uses a signature_len
pointer to capture the actual signature length. For a 256-bit EC key, I'd expect the signature to be twice as long or 64 bytes (r & s, we would not return a v component).
I need to perform signing/verification and/or encryption/decryption using a key present in hsm. To elaborate, I wan to fetch the key from aws cloudhsm and the use that key to perform crypto operations. I am able to fetch the key using C_FindObjectsInit, C_FindObjects and C_FindObjectsFinal function. But when performing the cryptographic operations like signing or encryption, initialisation itself it failing i.e. C_EncryptInit / C_SignInit is giving error.