certiffix
v2.1.0
Published
Generate self-signed CA certificates, and certificates signed by your own CA
Downloads
213
Maintainers
Readme
Certiffix
Generate development certificates using self-signed CA root certificates. This command will assist you in generating self-signed Certificate Authorities. These can then be used to sign certificate requests. You can then have your browser or system trust these generated authorities, and all certificates signed by them will be considered valid.
On unix based systems it stores the certificates it generates in ~/.config/certiffix/
Installation
npm install -g certiffixUsage
certiffix <command> [options]Run certiffix <command> --help for detailed help on a specific command.
Commands
| Command | Purpose |
|---------|---------|
| certiffix generate-ca | Generate a self-signed CA Root Certificate |
| certiffix generate | Generate a certificate signed by a CA |
| certiffix install | Install certificates to target locations |
Quick Start
# 1. Generate a CA certificate
certiffix generate-ca
# 2. Generate a certificate signed by your CA
certiffix generate --ca ~/.config/certiffix/ca/my_ca.ca.pem example.com
# 3. Install the certificate to your project
certiffix install --cert example_com /path/to/your/project/sslgenerate-ca
Generate a self-signed CA Root Certificate.
certiffix generate-ca [options]| Argument | Aliases | Description |
|----------|---------|-------------|
| --common-name | --cn | Common Name for the CA certificate |
| --country | --c | Country code (e.g., "US") |
| --state | --st | State or province |
| --county | --l, --locality | County or locality |
| --organization | --org, --o | Organization name |
| --unit | --ou | Organizational unit |
| --email | | Email address |
| --days | | Validity period in days (default: 398) |
| --yes | -y | Skip confirmation prompts |
Examples:
# Interactive mode - prompts for all values
certiffix generate-ca
# Non-interactive with all options
certiffix generate-ca --cn "My Dev CA" --org "My Company" --country US --state CA --yesgenerate
Generate a certificate signed by a CA.
certiffix generate [options] [domain]| Argument | Aliases | Description |
|----------|---------|-------------|
| --ca | | Path to CA certificate for signing |
| --common-name | --cn | Domain name for the certificate |
| --country | --c | Country code (e.g., "US") |
| --state | --st | State or province |
| --county | --l, --locality | County or locality |
| --organization | --org, --o | Organization name |
| --unit | --ou | Organizational unit |
| --email | | Email address |
| --days | | Validity period in days (default: 398) |
| --ip | | IP addresses for SAN (default: 127.0.0.1, repeatable) |
| --wildcard | --wild | Generate wildcard certificate |
| --yes | -y | Skip confirmation prompts |
Smart Wizard Mode
When --ca is provided with a domain argument, smart wizard mode is enabled:
- Fields are pre-populated from the CA certificate
- CLI arguments override CA defaults
- Domains starting with
*.automatically enable wildcard mode
Examples:
# Interactive mode - prompts for CA selection and all values
certiffix generate
# Smart wizard - inherit fields from CA
certiffix generate --ca ~/.config/certiffix/ca/my_ca.ca.pem example.com
# Wildcard certificate (auto-detected)
certiffix generate --ca ~/.config/certiffix/ca/my_ca.ca.pem *.example.com
# Multiple IP addresses
certiffix generate --ca ~/.config/certiffix/ca/my_ca.ca.pem example.com \
--ip 127.0.0.1 --ip 192.168.1.100install
Install certificates to target locations.
certiffix install --cert <name> [options] <target-path>| Argument | Description |
|----------|-------------|
| --cert | Certificate name (required) |
| --ca | CA certificate path (for installing CA cert) |
| --public | Install public certificate (boolean or custom path) |
| --private | Install private key (boolean or custom path) |
| --authority | Install CA certificate (requires --ca) |
| --flat | Use flat directory structure (no subdirectories) |
| --yes, -y | Skip confirmation prompt |
Flag Behavior
- No flags specified: Installs public and private (+ CA if
--caprovided) - Any flag specified: Only installs specified files
- Boolean flag (
--public): Uses default path structure - Flag with value (
--public=/path/cert.pem): Uses custom path
Directory Structures
Default structure:
<target-path>/
├── public/
│ └── {name}.pem
├── private/
│ └── {name}.key
└── ca/
└── {ca-name}.ca.pemFlat structure (--flat):
<target-path>/
├── {name}.pem
├── {name}.key
└── {ca-name}.ca.pemExamples:
# Install all files (public + private)
certiffix install --cert example_com /etc/ssl/app
# Install all files including CA
certiffix install --cert example_com --ca ~/.config/certiffix/ca/my_ca.ca.pem /etc/ssl/app
# Install with flat structure
certiffix install --cert example_com --public --private --flat /etc/ssl/app
# Custom paths
certiffix install --cert example_com \
--public=/etc/nginx/ssl/cert.pem \
--private=/etc/nginx/ssl/key.pem \
/etc/nginx/sslCertificate Storage
All certificates are stored in ~/.config/certiffix/:
~/.config/certiffix/
├── ca/ # CA certificates
│ ├── {name}.ca.key # CA private key
│ └── {name}.ca.pem # CA public certificate
├── private/ # Certificate private keys
│ └── {name}.key
└── public/ # Certificate public files
└── {name}.pemRequirements
- Node.js
- OpenSSL (must be available in PATH)
License
ISC
