Replies: 1 comment
-
|
When passing an object you’re expected to pass a JWK. That means k should already be base64url encoded as per the spec. When passing a string or a buffer it’s by design that the value you passed be the actual secret so it’s encoded into a JWK for you. You haven’t found anything in the doc because this is the spec. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I realised the secret key generation with
asKey(<object>)andasKey(<string>)give different result for the same givensecret.The
asKey(<string>)performs a base64 encoding of the secret prior to generation. TheasKey(<object>)does not.See the following example:
In the example above, I would expect
key1andkey2to be the same key as they are fed with the samesecretandkey3to be different.Is that an intended behavior ?
I haven't find anything clarifying that in the doc.
Beta Was this translation helpful? Give feedback.
All reactions