You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to import the key I am receiving the error: undefined:1 Uncaught (in promise) DOMException: The JWK member "k" could not be base64url decoded or contained padding
I know the trailing equal signs indicate there is padding on the key ==, but I'm not sure how to remove it and still import using the same method. It seems like I would have to convert it to an ArrayBuffer and then remove the trailing 0's somehow, but then if we have to use raw key import it makes using jwk seems less useful and I thought there must be a better way or perhaps the import jwk should just handle this for us.
The text was updated successfully, but these errors were encountered:
@mattmazzola Just in case this hasn't been resolved yet: JWK accepts Base64URL encoded values for x, y, and d, so probably finding a base64 conversion library that supports both modes would be easiest.
Hi,
I was experimenting with your examples to try to recreate a browser version of:
https://www.npmjs.com/package/jwt-simple
Here is a gist to explain end goal (although this gist doesn't work):
https://gist.github.com/mattmazzola/1eafd7aea79e082982da203ec0405997
When attempting to import the key I am receiving the error:
undefined:1 Uncaught (in promise) DOMException: The JWK member "k" could not be base64url decoded or contained padding
I was using this example: https://github.com/diafygi/webcrypto-examples#hmac---importkey
I know the trailing equal signs indicate there is padding on the key
==
, but I'm not sure how to remove it and still import using the same method. It seems like I would have to convert it to an ArrayBuffer and then remove the trailing 0's somehow, but then if we have to use raw key import it makes using jwk seems less useful and I thought there must be a better way or perhaps the import jwk should just handle this for us.The text was updated successfully, but these errors were encountered: