OpenSSL Command Generator

Build copy-pasteable OpenSSL commands for keys, certificates and encryption without running them.

  • Runs locally in your browser
  • No upload required

Try it

Task
self-signed
Command
openssl req -x509 -new -key private-key.pem -sha256 -days 365 -subj /CN=example.com/O=Example -out cert.pem
Warning
A self-signed certificate is not trusted by browsers until it is explicitly imported.
Note
This tool only prints a command; it never executes it or reads a private key.

Supported formats

Input
text, select, number
Output
text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Built an OpenSSL command for the "rsa-key" task.

How it works

  • Read the task and its file parameters.
  • Validated every file name so no shell metacharacter can enter the command.
  • Assembled the command with POSIX single-quote escaping.
  • Returned the text; nothing was executed and no file was read.
  • This tool only prints a command; it never executes it or reads a private key.

Methodology

  1. Map the selected task to the canonical OpenSSL sub-command and options.
  2. Validate every file name against a strict allow-list and reject anything that could alter the shell command.
  3. Quote each argument for a POSIX shell so the command is safe to paste.
  4. Attach a warning to operations that produce or transport private key material.

Usage

  1. Choose the task you want to perform.
  2. Fill in the file names and the task parameters (key size, subject, days, digest).
  3. Copy the generated command and run it in your own shell.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

Generate a 4096-bit RSA private key

jsonSelect to copy
{
  "task": "rsa-key",
  "file": "private-key.pem",
  "rsaBits": 4096
}

Create a self-signed certificate

jsonSelect to copy
{
  "task": "self-signed",
  "file": "cert.pem",
  "keyFile": "private-key.pem",
  "subject": "/CN=example.com/O=Example",
  "days": 365
}

Create a certificate signing request

jsonSelect to copy
{
  "task": "csr",
  "file": "request.csr",
  "keyFile": "private-key.pem",
  "subject": "/CN=example.com/O=Example"
}

SHA-256 digest of a file

jsonSelect to copy
{
  "task": "digest",
  "file": "archive.tar",
  "digest": "sha256"
}

Inspect a certificate

jsonSelect to copy
{
  "task": "inspect-cert",
  "file": "cert.pem"
}

Limitations

A generator, not a runner

Keeping the tool as a pure command builder is both safer and more honest: you review the command before it runs, and the page never needs access to your filesystem or your keys. The file-name allow-list prevents the generator from emitting a command that could be abused by a crafted name.

Private-key hygiene

Generate keys with a strong algorithm and size, keep them out of version control, and never pass a passphrase on the command line. For transport, a password-protected PKCS#12 bundle is convenient but still carries the private key; protect the export password.

Frequently asked questions

Does this run OpenSSL?
No. It only assembles the command text. Nothing is executed, no file is read and no network request is made.
Why does the tool refuse some file names?
File names are restricted to letters, digits, dot, underscore, slash and hyphen so a name cannot inject a shell metacharacter into the command. If you need spaces, rename the file.
How do I protect the private key?
Use an encrypted key (`openssl genpkey` with a passphrase) and a PKCS#12 bundle for transport, and let OpenSSL prompt for the passphrase rather than passing it on the command line.

Sources

  1. OpenSSL Documentation — Command Line Utilities — OpenSSL Project
  2. RFC 5280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile — IETF
  3. RFC 7468: Textual Encodings of PKIX, PKCS, and CMS Structures — IETF