-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use Cert files #56
Comments
Hi, to generate a Please take a look at this documentation and the containing examples and let me know if they helped: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey If you just want to generate a Thanks! |
Looks like pkcs8 is not available in deno 🤔 |
Easiest way is to declare a Global var for your key and use it to create and verify your JWT. Just put this code in your Starting Application declare global { window.keys = await crypto.subtle.generateKey( ##to create JWT token: const jwtpayload: Payload = { const jwtheader: Header = { const jwt = await create(jwtheader,jwtpayload,keys.privateKey) ##to verify: await verify(jwt,keys.publicKey) ##I think this is not a good practice but it works, hope it will help. ##Edited: Derived from RSA of timonson. |
For my application I need to use RSA and I need the tokens to be valid even after a restart. |
Hi @itohatweb , pkcs8 has been implemented by the deno authors now. I added an example for generating, exporting and importing a key in pkcs8 format here. Does it help? |
Yes thank you. |
I noticed djwt now wants a CryptoKey and not cert strings anymore. Since I'm pretty new to crypto I would love to have an example of how to use eg RSA key files.
The text was updated successfully, but these errors were encountered: