Open DigitalLeaves opened 6 years ago
Hello?
Hi, i´m having this problem too. DId you resolve this issue? thanks
Try SHA-384 maybe node.js lib cannot correctly truncate short digests. Openssl probably expects ASN.1 encoded signature, plugin returns concatenated (R || S)
Is there a complete code example that sign ( ok this part i can do) and verify a file? I have the signature but i dont know what to do now to verify. Why hwcrypto don´t have this "verify" method?
because it is not in scope and window.hwcrypto references missing feature in https://developer.mozilla.org/en-US/docs/Web/API/Window/crypto spec. You can try https://hwcrypto.github.io/hwcrypto.js/sign.html use JWT token signing and use SHA-384 with ECC 384 token and then it will show link to jwt.io to validate signature. (JWT page does not refresh signature status on page load. Add space to end of data and remove it and then page will revalidate input)
Hey all. I came across this while trying to resolve the same issue myself. I came up with this reference python script:
https://gist.github.com/dvas0004/3f2dbf2a3ce16bdc865766b990da0e6f
Replace with your own certificate and signature which can be easily copy/pasted off the hwcrypto demo site: https://hwcrypto.github.io/demo/
I would assume you can find something similar in JS, my biggest problem was getting the right formatting - I was honestly under the impression the cards used RSA keys - i guess these got replaces with ECC since the recall last year...
Anyways hope this helps!
Hello there! Thanks for this example, really helped me getting started with authentication using the e-Card.
I have the problem that I cannot verify the signatures I get from hwcrypto. As far as I know, these are secp384 EC keys. Then, I generate a SHA1 signature from "Hello world!" and put it as the SHA1 signature in the html page to be signed. Then I generate correctly a signature, but when I use node.js crypto module to verify the signature it always return false (using the signature I get from hwcrypto.js):
I have tried with SHA256 also.
This is the result:
If I try in openssl, I get this error:
Any suggestion or insight in how to verify it will be greatly appreciated.