Skip to main content

Generate RSA key pair

Create public.pem and private.pem in a folder; keep the private key protected. Existing keys stop the step, or are replaced or kept as a backup (key rotation).

Command in the Hash and encrypt toolkit · id ooa.crypto/rsa_generate_keys · 3 inputs (1 required), 3 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
FolderFileYesFolder for the key files.
If keys existStringNoerrorWhen the folder already has keys: error stops with CRYPTO.KEY_EXISTS; rotate renames them to *.pem.<date-time>.bak first; overwrite replaces them (the old private key is lost).
Key sizeNumberNo3072Key length in bits; 3072 or more is recommended.

Outputs​

OutputTypeWhat it is
public_keyFilePublic key path.
private_keyFilePrivate key path.
backup_private_keyFileWith if_keys_exist = rotate: where the previous private key was moved; empty otherwise.