Generating RSA Key Pair in Workers

I’ve been working on a project that is utilizing Cloudflare Workers and want to generate RSA key pairs (crypto.subtle.generateKey using RSASSA-PKCS1-v1_5). I landed here from https://developers.cloudflare.com/workers/reference/apis/web-crypto/ so hopefully this is the most appropriate way to request it be added :pray:

I’m planning to use Cloudflare Workers to generate RSA public and private keys for use in signing/verifying JWTs and sharing the public key via a JWK endpoint.

Edit: So far I’ve worked around it using an AWS Lambda function to generate the key pair but also run into Asymmetric key export is not implemented. when trying to use exportKey into JWK format. I used node forge to subsequently export the key in JWK format.

Hi @blakeembrey,

Feature request received! While I can’t guarantee a specific timeline, I’ve filed an internal ticket to track this. It’s something we should definitely implement.

Harris

3 Likes

crypto.subtle.generateKey is implemented for RSASSA-PKCS1-v1_5 as of release 2020.8.0.

2 Likes