Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion cmd/certkit/csr.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,34 @@ var csrCmd = &cobra.Command{
Long: `Generate a CSR from a JSON template, existing certificate, or existing CSR.

A new key is generated unless --key is provided. Output is printed to stdout
by default (PEM format). Use -o to write files to a directory instead.`,
by default (PEM format). Use -o to write files to a directory instead.

The --template flag accepts a JSON file with the following structure:

{
"subject": {
"common_name": "example.com",
"organization": ["My Corp"],
"organizational_unit": ["Engineering"],
"country": ["US"],
"province": ["California"],
"locality": ["San Francisco"]
},
"hosts": [
"example.com",
"*.example.com",
"10.0.0.1",
"admin@example.com",
"spiffe://cluster.local/ns/default/sa/web"
],
"other_names": [
{"type": "UPN", "value": "user@example.com"}
]
}

Hosts are auto-classified as DNS names, IP addresses, emails, or URIs.
The other_names field is optional and supports UPN, SRV, XMPP,
SmtpUTF8Mailbox, or a dotted-decimal OID.`,
Example: ` certkit csr --template request.json
certkit csr --from-cert existing.pem --algorithm rsa --bits 4096
certkit csr --from-csr old.csr --key mykey.pem
Expand Down
Loading