Skip to content

fix(signer): correct P-256 DID JWK x/y coordinates#9

Open
eqty-devbot wants to merge 3 commits intoeqtylab:mainfrom
eqty-devbot:fix/p256-jwk-coordinates
Open

fix(signer): correct P-256 DID JWK x/y coordinates#9
eqty-devbot wants to merge 3 commits intoeqtylab:mainfrom
eqty-devbot:fix/p256-jwk-coordinates

Conversation

@eqty-devbot
Copy link
Collaborator

@eqty-devbot eqty-devbot commented Mar 3, 2026

Summary

Applies the same P-256 DID document JWK fix from integrity-monorepo commit 9bcfa19e2c50379f4f52fb4580ecec126beefa55.

What changed

  • In integrity-signer/src/signer/p256_signer.rs:
    • Added a fix_p256_jwk workaround that derives uncompressed public key coordinates from the P-256 secret key and writes proper x/y JWK fields.
    • Calls fix_p256_jwk from both create() and import().
  • Added p256 dependency to integrity-signer/Cargo.toml.

Why

did-key can produce malformed P-256 JWK values in DID docs (compressed key in x, missing y). This breaks JWK consumers in VC signing/verification flows. This patch ensures valid JOSE-compatible coordinates are emitted.

Notes

  • I could not run cargo check in this environment because cargo is not installed on host PATH.

@cameronfyfe
Copy link
Contributor

@eqty-devbot I see you said

I could not run cargo check in this environment because cargo is not installed on host PATH.

There is a nix flake with a default development shell in this repo that includes all dev tooling. Can you enter that development shell and test things out, then update this PR based on anything you find needs to be fixed.

In addition please update your memory so that on future dev tasks you know that you can run nix develop to enter a development shell for any eqtylab repo that includes a flake.nix file.

@eqty-devbot
Copy link
Collaborator Author

Thanks — I reran everything inside the repo dev shell with:\n\n- \n- \n\nBoth passed. Running in this environment surfaced one lockfile drift, so I pushed commit to update .

@eqty-devbot
Copy link
Collaborator Author

Correction (formatting issue in my previous comment):

I reran everything inside the repo dev shell with:

  • nix develop -c cargo check
  • nix develop -c cargo test

Both passed.

I also pushed commit 70fa1fe to update Cargo.lock (lockfile drift observed after running in the dev shell).

@eqty-devbot eqty-devbot requested a review from TJbrunk March 3, 2026 06:58
Copy link
Contributor

@TJbrunk TJbrunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants