Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

privateKey.x missing for Elliptic Curve JWT keys #27972

Closed
d70-t opened this issue Feb 5, 2025 · 0 comments · Fixed by #27990
Closed

privateKey.x missing for Elliptic Curve JWT keys #27972

d70-t opened this issue Feb 5, 2025 · 0 comments · Fixed by #27990
Assignees
Labels
crypto Related to node:crypto or WebCrypto node compat

Comments

@d70-t
Copy link

d70-t commented Feb 5, 2025

Version: Deno 2.1.7

According to RFC 8037 2, OKP private key JWTs must include all members required for the public key counterpart. In particular, private and public keys must include kty, crv and x, while the private key must additionally contain d.

However, when runninng the following code:

import { generateKeyPairSync } from "node:crypto"

console.log(generateKeyPairSync('ed25519', {
    publicKeyEncoding: { type: 'spki', format: 'jwk' },
    privateKeyEncoding: { type: 'pkcs8', format: 'jwk' }
}))
  • in deno: privateKey.x is missing
  • in node: privateKey.x is available
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto Related to node:crypto or WebCrypto node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants