RSA Key Generator
Generates RSA public/private keypair (1024, 2048, 3072, 4096-bit, PEM & DER)
Overview
Generates a fresh RSA public/private keypair (PKCS#1 v2.2 / RFC 8017) of the selected modulus bit length (1024, 2048, 3072, or 4096 bits) and public exponent ($e = 65537$ or $e = 3$).
For maximum convenience across downstream nodes and external tools, the node simultaneously emits the generated keypair in both ASCII PEM format (Public Key (PEM) / Private Key (PEM) as String, using SPKI and PKCS#8 wrappers) and binary DER format (Public Key (DER) / Private Key (DER) as Bytes).
When to Use
- Generating RSA keypairs for RSA-OAEP Encrypt / Decrypt or RSA Sign / Verify.
- Exporting standard SPKI PEM/DER public keys and PKCS#8 PEM/DER private keys for inspection or external interoperability.
Parameter Configuration
| Parameter (ID) | Type & Default | Visibility Condition | Description & Options |
|---|---|---|---|
Key Size (Modulus Bits)modulusLength |
selectDefault: 2048 |
Always visible | RSA modulus size in bits: 1024 (128B, fast test only), 2048 (256B, standard), 3072 (384B, high security), or 4096 (512B, ultra security; takes longer to generate).
|
Public Exponent (e)publicExponent |
selectDefault: 65537 |
Always visible | RSA public exponent $e$: 65537 ($2^{16}+1$, standard Fermat prime $F_4$) or 3 (legacy/educational fast verification).
|
Intended Primary Usageusage |
selectDefault: encrypt |
Always visible | Documents the intended primary key usage context (encrypt for RSA-OAEP or sign for RSA-PSS / PKCS#1 v1.5); the generated key material works with both RSA encryption and RSA signature nodes in NodeCrypto.
|
Port I/O Specification
See Ports & Connections for general wiring rules, data type colors, and dynamic port creation.
Input Ports
This node has no input ports.
Output Ports
Port Nature: Fixed Output Ports (4 total).
| Port Name | Port ID | Data Type | Visibility Condition | Description |
|---|---|---|---|---|
Public Key |
publicKeyPem |
String |
Always visible | RSA public key formatted as a PKIX SubjectPublicKeyInfo (SPKI) PEM string (-----BEGIN PUBLIC KEY-----). |
Private Key |
privateKeyPem |
String |
Always visible | RSA private key formatted as a PKCS#8 PrivateKeyInfo PEM string (-----BEGIN PRIVATE KEY-----). |
Public Key |
publicKeyDer |
Bytes |
Always visible | Binary ASN.1 DER encoding (Uint8Array) of the SPKI public key. |
Private Key |
privateKeyDer |
Bytes |
Always visible | Binary ASN.1 DER encoding (Uint8Array) of the PKCS#8 private key. |
Error Cases
This node has no runtime failure cases (errorProfile: none) and always succeeds for any valid typed input.
Examples
Generating a 2048-bit RSA Keypair for Encryption or Signing
Create an RSA-2048 keypair and wire the DER or PEM outputs to downstream RSA nodes.
- Leave Key Size at
2048-bit (Standard)and Public Exponent at65537. - Connect
Public Key (DER)to RSA-OAEP Encrypt andPrivate Key (DER)to RSA-OAEP Decrypt.