Provide a way to derive a public key from a private key?
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 294
- Forks
- 78
- PR merge metrics
- No merged PRs in 30d
Description
In https://github.com/WICG/webcrypto-secure-curves/issues/26, it was requested to provide a method to derive a public key from a private key for Ed25519, but this may be useful to provide a generic method for.
There is a workaround by exporting the private key as JWK, which typically also contains the public key material. However, this requires to then manually take the public key properties from the JWK (and which ones those are depends on the algorithm).
Perhaps it would be simpler to provide an explicit method for this; e.g. crypto.subtle.getPublicKey(privateKey)?
Alternatively, we could allow exporting public keys from private key objects, such that (in combination with #393) the following would be possible:
const privateKey = await crypto.subtle.importKey('raw-private', privateKeyMaterial, 'Ed25519', false, ['sign']);
const publicKeyMaterial = await crypto.subtle.exportKey('raw-public', privateKey);
(which would be more convenient if what you want is the public key material, but less convenient if you want a public key object).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked webcrypto-secure-curves issue and the alternatives described here, including crypto.subtle.getPublicKey(privateKey) and exporting public keys from private keys. Done means selecting and specifying a generic API approach that covers the requested Ed25519 use case and relates clearly to issue #393.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, cryptography
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100