From d2759790b6a91e308d255208e1a9df8a7378cbfe Mon Sep 17 00:00:00 2001 From: Jim Anderson Date: Wed, 7 Sep 2022 18:15:08 -0500 Subject: [PATCH] [SDK-3623] Fix ECPoint construction for getting public key --- src/main/java/com/auth0/jwk/Jwk.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/auth0/jwk/Jwk.java b/src/main/java/com/auth0/jwk/Jwk.java index 4457dda..b2c01e6 100644 --- a/src/main/java/com/auth0/jwk/Jwk.java +++ b/src/main/java/com/auth0/jwk/Jwk.java @@ -193,8 +193,8 @@ public PublicKey getPublicKey() throws InvalidPublicKeyException { case ALGORITHM_ELLIPTIC_CURVE: try { KeyFactory keyFactory = KeyFactory.getInstance(ALGORITHM_ELLIPTIC_CURVE); - ECPoint ecPoint = new ECPoint(new BigInteger(Base64.getUrlDecoder().decode(stringValue("x"))), - new BigInteger(Base64.getUrlDecoder().decode(stringValue("y")))); + ECPoint ecPoint = new ECPoint(new BigInteger(1, Base64.getUrlDecoder().decode(stringValue("x"))), + new BigInteger(1, Base64.getUrlDecoder().decode(stringValue("y")))); AlgorithmParameters algorithmParameters = AlgorithmParameters.getInstance(ALGORITHM_ELLIPTIC_CURVE); String curve = stringValue("crv");