Replies: 1 comment
-
Hi. I suggest you to use the KeyObject export() method. link nodejs doc eg, after that you have generate the public and private key
Or, if you want to use the method of jose, see this doc |
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
-
Hello, I am attempting to generate an RS256 keypair for use in signing and authenticating access tokens, but I don't know how to get a string that I can save to a .env file from the generateKeyPair function.
Logging publicKey and privateKey to the console gives me this:
PublicKeyObject { [Symbol(kKeyType)]: 'public' }
PrivateKeyObject { [Symbol(kKeyType)]: 'private' }
Also, although I am implementing a simple access token/refresh token authentication system right now I would like to upgrade this system in the future - so I'm wondering how I can automate the creation of new key pairs every 24 hours or so and update a set of keypairs which rotate during the creation of new access/refresh tokens. I am using an .env file to store the private and public keys but I don't know how to update the properties of an .env file.
Beta Was this translation helpful? Give feedback.
All reactions