You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to verify a message.
I have the message, signature and public key, but no private key.
When verifying the message, I get the error: Signature without r or s
Public key format is: '04' + X + Y
Signature format is: R + S
Both in hex.
Am I doing something wrong or is this a bug?
My code:
var msg = '...'; // hidden
var pubKey = '04e6f90994768e51c2834879841542992494b9030e1b765e766f8b60a56213fb9f91903ee24f6baaaaf6afbce3adcfbc4362c1e1e21218ed3f1be6317908db3323';
var signature = 'b32911bfd9f88ae4a0c337df2c0f254d2232a162b85ce3019c2ae7cb1f56f06b525b4813557ace1e6f2f2080e77dd49ecec49d030a4fa23854880e696e941344';
var ecdsa = new elliptic.ec('p256');
var res = ecdsa.verify(msg, signature, pubKey, 'hex'); // throws exception
I've tried to use the ec/Signature class to load this, but no success too.
Thanks.
The text was updated successfully, but these errors were encountered:
var pubKey = '04e6f90994768e51c2834879841542992494b9030e1b765e766f8b60a56213fb9f91903ee24f6baaaaf6afbce3adcfbc4362c1e1e21218ed3f1be6317908db3323';
var signature = 'b32911bfd9f88ae4a0c337df2c0f254d2232a162b85ce3019c2ae7cb1f56f06b525b4813557ace1e6f2f2080e77dd49ecec49d030a4fa23854880e696e941344';
var msg = '...'; // sth secret
var m = signature.match(/([a-f\d]{64})/gi);
signature = {
r: m[0],
s: m[1]
};
var ecdsa = new elliptic.ec('p256');
var res = ecdsa.verify(msg, signature, pubKey, 'hex');
I want to verify a message.
I have the message, signature and public key, but no private key.
When verifying the message, I get the error:
Signature without r or s
Public key format is:
'04' + X + Y
Signature format is:
R + S
Both in hex.
Am I doing something wrong or is this a bug?
My code:
I've tried to use the
ec/Signature
class to load this, but no success too.Thanks.
The text was updated successfully, but these errors were encountered: