Skip to content

Expose key material of EC JWKs again - #763

Open
jnbdz wants to merge 1 commit into
eclipse-vertx:masterfrom
SiteNetSoft:fix-jwk-ec-publickey
Open

Expose key material of EC JWKs again#763
jnbdz wants to merge 1 commit into
eclipse-vertx:masterfrom
SiteNetSoft:fix-jwk-ec-publickey

Conversation

@jnbdz

@jnbdz jnbdz commented Aug 16, 2026

Copy link
Copy Markdown

Fixes #762

Regression from a9d1ad4: JWK.publicKey()/privateKey() now go through signingAlgorithm.unwrap(), but the anonymous EC wrapper created by JWK.wrapECAlgo(...) did not override unwrap(), so for every EC key (ES256/ES384/ES512/ES256K, from JSON JWK, PEM or keystore) the chain stopped at the wrapper and both accessors returned null. RSA/PS/EdDSA keys were unaffected because they are not wrapped.

Fix: the wrapper delegates unwrap() to the wrapped DigitalSigningAlgorithm (one method). Nothing else about the wrapper changes — signing/verification still convert between JWS R+S and ASN.1 as before.

Tests: JWKTest gains publicECExposesPublicKey, privateECExposesKeyPair, pemECExposesKeys (all failed before the fix) and pemRSAExposesPublicKey as a control. vertx-auth-common, vertx-auth-jwt and vertx-auth-oauth2 suites are green locally.

Since a9d1ad4 JWK.publicKey()/privateKey() resolve the key through
signingAlgorithm.unwrap(). EC keys are wrapped by wrapECAlgo to convert
between JWS and ASN.1 signatures, and that wrapper did not override
unwrap(), so the chain stopped at the wrapper and both accessors returned
null for ES256/ES384/ES512/ES256K keys (JSON JWK, PEM and keystore alike).

The wrapper now delegates unwrap() to the wrapped algorithm. JWKTest gains
EC public/private (JSON and PEM) assertions with RSA as control.

Fixes eclipse-vertx#762
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.

JWK.publicKey()/privateKey() return null for EC keys since 5.1

1 participant