-
SummaryHello, I am always obtaining this error : Just replaced str2ab function by 'new TextEncoder().encode(privateKey)' because I had a format issue using it. I tried with my key, and keys from given examples, but none is working... Nextjs : v14 with Typescript My code : |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Honestly, I am not the biggest fan of going around installing packages, but |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for your answer @icyJoseph ! Related issue : panva/jose#345 Old commands : |
Beta Was this translation helpful? Give feedback.
-
|
Good news everyone, Node.js Middleware support landed in Next.js 15.2 (experimental). This is now ready for testing. For any issues you run into, please open new issues so we can track and address before marking it as stable. Thank you! https://nextjs.org/blog/next-15-2#nodejs-middleware-experimental |
Beta Was this translation helpful? Give feedback.
Thank you for your answer @icyJoseph !
I tried jose and I have encountered same problem... but I found the the solution
In fact I was using basic ssh-keygen / openssl commands to generate a public / private key pair, but it was in format PKCS#1 by default. Jose and crypto libraries need more recent format, like PKCS#8 (private key) and SPKI (public key)
Related issue : panva/jose#345
Old commands :