Skip to content

Commit

Permalink
Add TLDR examples for SSH and TLS sign commands
Browse files Browse the repository at this point in the history
  • Loading branch information
elonen committed Jul 29, 2024
1 parent 4db7bb3 commit e860517
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hsm_secrets/ssh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def get_ca(ctx: HsmSecretsCtx, get_all: bool, cert_ids: Sequence[str]):
def sign_ssh_user_key(ctx: HsmSecretsCtx, out: str, ca: str|None, username: str|None, certid: str|None, validity: int, principals: str, extensions: str, keyfile: str):
"""Make and sign an SSH user certificate
TYPICAL USAGE:
$ ssh sign-user -u john.doe -p admin,users id_ed25519_sk_jdoe.pub
[keyfile]: file containing the public key to sign (default: stdin)
If --ca is not specified, the default CA key is used (as specified in the config file).
Expand Down Expand Up @@ -89,6 +93,10 @@ def sign_ssh_user_key(ctx: HsmSecretsCtx, out: str, ca: str|None, username: str|
def sign_ssh_host_key(ctx: HsmSecretsCtx, out: str, ca: str|None, hostname: str, validity: int, principals: str|None, keyfile: str):
"""Make and sign an SSH host certificate
TYPICAL USAGE:
$ ssh sign-host -H wiki.example.com -p "wiki.*,192.168.80.80" ssh_host_rsa_key.pub
[keyfile]: file containing the public key to sign (default: stdin)
If --ca is not specified, the default CA key is used (as specified in the config file).
Expand Down
4 changes: 4 additions & 0 deletions hsm_secrets/tls/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ def cmd_tls(ctx: click.Context):
def server_cert(ctx: HsmSecretsCtx, out: click.Path, common_name: str, san_dns: list[str], san_ip: list[str], validity: int, keyfmt: str, sign_crt: str):
"""Create a TLS server certificate + key
TYPICAL USAGE:
$ hsm-secrets tls server-cert -o wiki.example.com.pem -c wiki.example.com -d intraweb.example.com
Create a new TLS server certificate for the given CN and (optional) SANs.
Basic name fields are read from the config file (country, org, etc.)
Expand Down

0 comments on commit e860517

Please sign in to comment.