sscgen
is a command-line tool written in Go that generates self-signed X.509 certificates for testing or development purposes.
-
Install Go (if not already installed) by following the instructions at https://golang.org/doc/install.
-
Clone the
sscgen
repository:git clone https://github.com/joshburnsxyz/sscgen.git cd sscgen
-
Build the
sscgen
binary:make
-
Move the
sscgen
binary to a directory included in your system'sPATH
(e.g.,/usr/local/bin
):sudo mv dist/sscgen /usr/local/bin
To generate a self-signed certificate, run the sscgen
command followed by the desired options:
sscgen --host example.com --start-date "Jan 1 15:04:05 2024" --duration 365 --rsa-bits 4096 --ecdsa-curve P256 --ed25519
--host
: Comma-separated list of hostnames and IP addresses for which the certificate should be valid.--start-date
: Creation date of the certificate (default: current date).--duration
: Duration for which the certificate should be valid (default: 365 days).--rsa-bits
: Size of the RSA key to generate (default: 2048 bits).--ecdsa-curve
: ECDSA curve to use for generating the key (default: P256).--ed25519
: Generate an Ed25519 key instead of an RSA or ECDSA key.
The sscgen
tool will generate two files: cert.pem
and key.pem
.
cert.pem
: Contains the self-signed X.509 certificate in PEM format.key.pem
: Contains the private key in PKCS#8 format.
Generate a self-signed certificate valid for example.com
and 127.0.0.1
for 1 year:
sscgen --host example.com,127.0.0.1 --duration 365
Generate a self-signed certificate using an Ed25519 key:
sscgen --host example.com --ed25519
This project is licensed under the GNU GPLv3 License.