w3c / w3c/webcrypto

Add `raw-private` (and possibly `raw-public` and `raw-secret`) key formats?

Open
#393 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
294
Forks
78
PR merge metrics
No merged PRs in 30d

Description

Currently, it's not possible to import or export a raw private X25519, Ed25519, ECDH or ECDSA key.

The spec says raw is "An unformatted sequence of bytes. Intended for secret keys." However, in the mentioned asymmetric algorithms it's actually used to import and export public keys. And unlike with pkcs8, spki and jwk, there's no natural way to tell from the format name and/or data whether it's a private or a public key.

So, we could introduce a raw-private key format for importing and exporting raw private keys.

Conversely, we could introduce raw-public for importing and exporting raw public keys, and deprecate the usage of raw for that purpose.

To complete the trio, we could introduce raw-secret for importing and exporting raw secret keys, and deprecate raw entirely.

(In the future, when we add ML-KEM, we may also want raw-seed to import/export the private key seed.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Web Cryptography specification section for the raw key format and compare the private, public, and secret-key use cases described in this issue. Done means the project has a resolved decision about which additional formats, if any, should be introduced and how existing raw usage is handled.

Written by the indexing model from the issue text.

Assessment

Domain
cryptography
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.