From 6bae5b06305fed3f70fabe8117ec0703279858bf Mon Sep 17 00:00:00 2001 From: Slawomir Koszewski Date: Sat, 25 Apr 2026 00:02:42 +0200 Subject: [PATCH] Add Go port documentation and usage instructions to README --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index 235895a..5439ae2 100644 --- a/README.md +++ b/README.md @@ -55,3 +55,42 @@ make_pfx --ca-dir [--issuing-ca ] --path `: The file prefix of the issuing CA to include in the chain. - `--path `: The path where the generated PFX file will be saved. - `--password `: Optional. The custom password to protect the PFX, instead of the default `changeit`. + +## Go binary + +A Go port with the same feature set lives in [`src/simple-ca`](src/simple-ca). It compiles to a single self-contained binary (~5–6 MB) with no runtime dependencies, and exposes `make-ca`, `make-cert`, and `make-pfx` as subcommands mirroring the Bash flag names. + +### Build for the host platform + +```bash +cd src/simple-ca +go build -o simple-ca . +./simple-ca --help +``` + +### Cross-compile + +Go builds statically linked binaries for any target from any host: + +```bash +cd src/simple-ca + +# Linux +GOOS=linux GOARCH=amd64 go build -o simple-ca-linux-amd64 . +GOOS=linux GOARCH=arm64 go build -o simple-ca-linux-arm64 . + +# macOS +GOOS=darwin GOARCH=amd64 go build -o simple-ca-darwin-amd64 . +GOOS=darwin GOARCH=arm64 go build -o simple-ca-darwin-arm64 . + +# Windows +GOOS=windows GOARCH=amd64 go build -o simple-ca-windows-amd64.exe . +``` + +### Usage + +```bash +simple-ca make-ca [--days N] [--issuing-ca PREFIX] [--aia-base-url URL] CA_DIR CA_NAME +simple-ca make-cert [--ca-dir DIR] [--days N] [--issuing-ca PREFIX] CERT_DIR SUBJECT [SAN...] +simple-ca make-pfx --ca-dir DIR [--issuing-ca PREFIX] --path CERT_PATH [--password PASS] +```