node-jose icon indicating copy to clipboard operation
node-jose copied to clipboard

base64 Url-Safe value for k

Open gam04 opened this issue 1 year ago • 0 comments

Hi.

I have a question regarding the 'k' field of JWK. According to the following specification : https://www.rfc-editor.org/rfc/rfc7518.html#section-6.4.1

Should values for the 'k' field other than Base64 URL Safe be accepted?

If I create an object using jose.JWK.asKey using the following values:

{"kty":"oct","use":"sig","alg":"HS256","k":"gCwIZwLqrzbygmkv/8+PMEnqL6TiMMfqK6v4YjLtc5I="}

The key is created even though the 'k' field contains a non-Base64 URL Safe value.

Thanks in advance

gam04 avatar May 19 '23 18:05 gam04