Skip to content

Add Ed25519 key support#16

Open
manojpr-cb wants to merge 4 commits into
mainfrom
feature/ed25519-support
Open

Add Ed25519 key support#16
manojpr-cb wants to merge 4 commits into
mainfrom
feature/ed25519-support

Conversation

@manojpr-cb

@manojpr-cb manojpr-cb commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

What

Adds Ed25519 (EdDSA) signing support to the JWT auth path, alongside the existing ECDSA (ES256) keys.

  • generateJwt now detects the key type and signs accordingly:
    • ECDSA keys (PEM) sign with ES256, same as before.
    • Ed25519 keys sign with EdDSA, accepted either as a PKCS#8 PEM or as the base64 raw key the CDP portal hands out (32-byte seed or 64-byte seed+pubkey). Whitespace in the base64 is tolerated.
  • Ed25519 signing uses a small BouncyCastle-backed JWSSigner, so no new dependency is needed (nimbus would otherwise require Tink for OKP keys). EC keys are normalized through the default provider so the existing ECDSA path is unchanged.
  • Nonce is now a random value instead of the epoch second (the old one repeated for tokens minted in the same second).
  • Bumps the version to 0.2.2 and updates SDK_VERSION so the User-Agent reports the right version.

Testing

Verified against the live API with both ECDSA and Ed25519 keys: JWT structural checks (alg, kid, sub, nbf/exp, distinct nonces, signature verifies), a malformed-secret negative case, plus real REST calls all pass.

@manojpr-cb manojpr-cb requested a review from nmorgan-cb June 6, 2026 15:16
@manojpr-cb manojpr-cb requested a review from cfluke-cb June 6, 2026 15:36
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.

1 participant