/easy-ca-cli

A fast, simple and easy-to-use certificate generator.

Primary LanguageGoMIT LicenseMIT

Easy CA CLI

GitHub GitHub Workflow Status GitHub go.mod Go version GitHub release (latest by date)

A fast, simple and easy-to-use certificate generator.

Overview

key algorithm support

  • RSA
    • with key size: 10242048
  • ECDSA
    • ecdsa curve: P224P256P384P521
  • ED25591

generate certificate support

  • support certificate Authority、middle certificate authority、general TLS certificate
  • support certificate chain and private key in pkcs8 format
  • support specified output path

certificate info custom support

  • Subject
    • C、O、OU、CN、SERIALNUMBER、L、ST、POSTALCODE
  • Subject Alternative Name
    • dns names
    • ip addresses
  • valid from and valid for

Usage

Provider gen ca and gen tls commands for certificate generation, run help for more information about a command and its flags.

easy-ca-cli help

Examples

1、Generate a certificate authority with specified subject info、valid time and output path with ecdsa algorithm.

easy-ca-cli gen ca --ecdsa --ecdsa-curve P512 \
 --subject "C=CN,O=Easy CA,OU=IT Dept.,CN=Easy CA Root" \
 --start-date "Jan 1 15:00:00 2022" --days 3650 \
 --out-key ca_key.pem --out-cert ca_cert.pem

2、Generate a middle certificate authority using the certificate authority generated above

easy-ca-cli gen ca --ecdsa --ecdsa-curve P384 \
 --subject "C=CN,O=Easy CA,OU=IT Dept.,CN=Easy CA Authority R1" \
 --start-date "Jan 1 15:05:00 2022" --days 1800 \
 --issuer-key ca_key.pem --issuer-cert ca_cert.pem \
 --out-key mca_key.pem --out-cert mca_cert.chain.pem

3、Generate a TLS certificate using the certificate authority generated above

easy-ca-cli gen tls --rsa --rsa-keysize 2048 \
  --subject "C=CN,O=Easy CA,OU=IT Dept.,CN=easy-ca.com" \
  --host "easy-ca.com,www.easy-ca.com,cli.easy-ca.com" \
  --start-date "Jan 1 15:10:00 2022" --days 365 \
  --issuer-key mca_key.pem --issuer-cert mca_cert.chain.pem \
  --out-key easyca_key.pem --out-cert easyca_cert.chain.pem

Dependencies

LICENSE

Easy CA CLI is released under the MIT license. See LICENSE