Replies: 1 comment 2 replies
-
@servlette Thanks for reporting. This sounds like a bug. Looking into it |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a JWK key like the following:
I am into migrating an app functionality from
Java
toGolang
and I can't just go ahead and update the JWK JSON to includep
in it or create a new JWK forGolang
as the existing one has to work against bothJava
andGolang
.Even though the value
p
is missing in the JSON as shown above, it worked in Java as the 3rd party library Nimbus Jose returned an instance ofRSAPrivateKey
by usingd
andn
.Please refer to it here:
https://github.com/felx/nimbus-jose-jwt/blob/47d66f2775c392964788aa6389a46fac84f976cd/src/main/java/com/nimbusds/jose/jwk/RSAKey.java#L1790
When
p
is null, then it is usingn
andd
to get the modulus and private exponent to initialize theRSAPrivateKey
instance:Once it gets the RSA private key, then it is used to sign a
JWT
as shown below:As we are into migrating the existing functionality to sign a JWT to
Golang
, we are stuck with the following issue.It panics with the following error:
In Java, I see the comment
// Use 1st representation
when p is null. I am not sure what it means to use1st representation
as it may be something to do with getting an RSA private key when the fieldp
is not present.Wondering if there is a way to get an RSA private key when
p
is missing using this go library.Beta Was this translation helpful? Give feedback.
All reactions