RSA JWK to PEM

Import an RSA-OAEP JWK and export a PKCS8 or SPKI PEM key.

Your workspace

Processed in your browser

Enter your values or try the example.

This utility converts an RSA-OAEP JSON Web Key (JWK) into a standard PEM-encoded format. It automatically detects whether the input is a public key (exporting to SPKI) or a private key (exporting to PKCS8) based on the presence of the 'd' parameter.

How to convert your JWK

  1. Paste your RSA JWK object into the input field. Ensure the JSON is valid and contains the necessary RSA components.
  2. The tool processes the key locally using the Web Crypto API and outputs the corresponding PEM block, which you can copy for use in your applications.

Supported formats and limitations

This tool is strictly limited to RSA-OAEP keys using the SHA-256 hash algorithm. If your JWK uses a different algorithm or curve, the conversion will fail. Note that the exported private key PEM is unencrypted; ensure you handle the output securely and do not store it in insecure locations.

Example conversion

{"kty":"RSA","n":"...","e":"AQAB"}

-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----

Frequently asked questions

Why does my conversion fail?

Conversion fails if the input is not a valid RSA JWK, uses an unsupported algorithm (anything other than RSA-OAEP with SHA-256), or is missing required RSA components.

How do I know if my output is public or private?

The tool automatically determines the key type. If the input JWK contains the private exponent 'd', it outputs a PKCS8 'PRIVATE KEY' block. Otherwise, it outputs an SPKI 'PUBLIC KEY' block.

Continue your workflow

Explore more tools in this category for your next step.