diafygi / diafygi/webcrypto-examples

How to recover public key with ECDSA?

Open
#37 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
1.7k
Forks
191
PR merge metrics
No merged PRs in 30d

Description

Any suggestions on how to implement [public key recovery](http://crypto.stackexchange.com/questions/18105/how-does-recovering-the-public-key-from-an-ecdsa-signature-work) with WebCrypto ECDSA?

How is (r,s) encoded in the output buffer of `sign`?
Is it just `r = [0,32)` and `s = [32,64)` for `curve = P-256` ([docs](https://www.w3.org/TR/2016/PR-WebCryptoAPI-20161215/#ecdsa-operations)) ?

Seams like [elliptic.js](https://github.com/indutny/elliptic/blob/cbace4683a4a548dc0306ef36756151a20299cd5/lib/elliptic/ec/index.js#L190) implements the recovery and it should be possible to import the recovered public key via jwk back into WebCrypto ...

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.