We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here's the code I'm using:
var EC = require('elliptic').ec, secp256k1 = new EC('secp256k1'), sigFormatter = require('ecdsa-sig-formatter') var privateKeyHex = 'a5c61c6ca7b3e7e55edee68566aeab22e4da26baa285c7bd10e8d2218aa3b229', publicKeyHex = '027d28f9951ce46538951e3697c62588a87f1f1f295de4a14fdd4c780fc52cfe69', privateKeyObject = secp256k1.keyFromPrivate(privateKeyHex, 'hex'), publicKeyObject = secp256k1.keyFromPublic(publicKeyHex, 'hex') var messageString = 'Hello, World', messageBuffer = new Buffer(messageString), messageBytes = messageBuffer.toJSON().data var derSignatureObject = privateKeyObject.sign(messageBytes), derSignatureArray = derSignatureObject.toDER(), derSignatureBuffer = new Buffer(derSignatureArray), joseSignature = sigFormatter.derToJose(derSignatureBuffer, 'ES256') console.log(derSignatureObject) var verified = publicKeyObject.verify(messageBytes, derSignatureBuffer) console.log(verified)
Is there some issue with the method or am I doing something wrong?
Thank you!
The text was updated successfully, but these errors were encountered:
This is because I'm using deterministic k generation for signature algorithm: http://tools.ietf.org/html/rfc6979 . Works as intended.
k
Thanks!
Sorry, something went wrong.
OK thank you!
No branches or pull requests
Here's the code I'm using:
Is there some issue with the method or am I doing something wrong?
Thank you!
The text was updated successfully, but these errors were encountered: