M6Ly9zcnYuZXhhbXBsZS5jb20iLCJzdWIiOiJhdXRoIn0 . DlSkxICjk2h1LarwJgXPbXQe7DwpLMOCvWp3I4GMcBP_5_QYPhVNBPQEeTKAUuQjYwlxZ5zVQnyp8ujvyf1Lqw ''' Verify the previous token: ''' $ echo $TOKEN | step crypto jwt verify --key p256.pub.json --iss "joe@example.com" --aud "https://example.com" { "header": { "alg": "ES256", "kid": "ZjGX97LmcflPolWvsoAWzC5WPWkNFFH3QdKLUW978hk", "typ": "JWT" }, "payload": { "aud": "https://example.com", "exp": 1535242472, "iat": 1532564073, "iss": "joe@example.com", "nbf": 1532564073, "srv": "https://srv.example.com", "sub": "auth" }, "signature": "DlSkxICjk2h1LarwJgXPbXQe7DwpLMOCvWp3I4GMcBP_5_QYPhVNBPQEeTKAUuQjYwlxZ5zVQnyp8ujvyf1Lqw" } ''' Read the information in the previous token without verifying it: ''' $ echo $TOKEN | step crypto jwt inspect --insecure { "header": { "alg": "ES256", "kid": "ZjGX97LmcflPolWvsoAWzC5WPWkNFFH3QdKLUW978hk", "typ": "JWT" }, "payload": { "aud": "https://example.com", "exp": 1535242472, "iat": 1532564073, "iss": "joe@example.com", "nbf": 1532564073, "srv": "https://srv.example.com", "sub": "auth" }, "signature": "DlSkxICjk2h1LarwJgXPbXQe7DwpLMOCvWp3I4GMcBP_5_QYPhVNBPQEeTKAUuQjYwlxZ5zVQnyp8ujvyf1Lqw" } ''' **step ca rekey** command rekeys the given certificate (with a request to the certificate authority) and writes the new certificate and private key to disk - either overwriting and positional arguments or using new files when the **--out-cert**= and **--out-key**= flags are used. With the **--daemon** flag the command will periodically update the given certificate. By default, it will rekey the certificate before 2/3 of the validity period of the certificate has elapsed. A random jitter is used to avoid multiple instances running at the same time. The amount of time between rekey and certificate expiration can be configured using the **--expires-in** flag, or a fixed period can be set with the **--rekey-period** flag. The **--daemon** flag can be combined with **--pid**, **--signal**, or **--exec** to provide certificate reloads on your services. The **--kms** flag rekeys an existing key in a KMS with another key from the same KMS. It does not support generating new keys, using the **--daemon** flag, or rekeying across different KMS instances. ## POSITIONAL ARGUMENTS : The certificate in PEM format that we want to rekey. : They key file of the certificate. ## EXAMPLES Rekey a certificate: ''' $ step ca rekey internal.crt internal.key ''' Rekey a certificate without overwriting the existing certificate and key: ''' $ step ca rekey --out-cert out.crt --out-key out.key internal.crt internal.key ''' Rekey a certificate forcing the overwrite of the previous certificate and key (overwrites the existing files without prompting): ''' $ step ca rekey --force internal.crt internal.key ''' Rekey a certificate which key is in a KMS, with another from the same KMS: ''' $ step ca rekey \ --kms 'pkcs11:module-path=/usr/local/lib/softhsm/libsofthsm2.so;token=smallstep?pin-value=password' \ --private-key 'pkcs11:id=4002' pkcs11.crt 'pkcs11:id=4001' ''' Rekey a certificate providing the <--ca-url> and <--root> flags: ''' $ step ca rekey --ca-url https://ca.smallstep.com:9000 \ --root /path/to/root_ca.crt internal.crt internal.key Would you like to overwrite internal.crt [Y/n]: y ''' Rekey a certificate only if it expires within the given time frame: ''' $ step ca rekey --expires-in 8h internal.crt internal.key ''' Rekey the certificate before 2/3 of the validity has passed: ''' $ step ca rekey --daemon internal.crt internal.key ''' Rekey the certificate before 8 hours and 30m of the expiration time: ''' $ step ca rekey --daemon --expires-in 8h30m internal.crt internal.key ''' Rekey the certificate every 16h: ''' $ step ca rekey --daemon --rekey-period 16h internal.crt internal.key ''' Rekey the certificate and reload nginx: ''' $ step ca rekey --daemon --exec "nginx -s reload" internal.crt internal.key ''' Rekey the certificate and convert it to DER: ''' $ step ca rekey --daemon --rekey-period 16h \ --exec "step certificate format --force --out internal.der internal.crt" \ internal.crt internal.key ''' Rekey a certificate using the offline mode, requires the configuration files, certificates, and keys created with **step ca init**: ''' $ step ca rekey --offline internal.crt internal.key ''' Rekey the certificate and write it to specified files: ''' $ step ca rekey internal.crt internal.key --out-crt foo.crt --out-key foo.key ''' Rekey the certificate using a given private key: ''' $ step ca rekey internal.crt internal.key --private-key foo.key '''# Helm template inject: enabled: true # Config contains the configuration files ca.json and defaults.json config: files: ca.json: root: {{ first .Root }} federateRoots: [] crt: {{ .Intermediate }} key: {{ .IntermediateKey }} {{- if .Kms }} kms: type: {{ lower (.Kms.Type | toString) }} {{- end }} {{- if .EnableSSH }} ssh: hostKey: {{ .Ssh.HostKey }} userKey: {{ .Ssh.UserKey }} {{- end }} address: {{ .Address }} dnsNames: {{- range .DnsNames }} - {{ . }} {{- end }} logger: format: json db: type: badgerv2 dataSource: /home/step/db authority: enableAdmin: {{ .EnableAdmin }} provisioners: {{- range .Provisioners }} - {{ . | toJson }} {{- end }} tls: cipherSuites: {{- range .TLS.CipherSuites }} - {{ . }} {{- end }} minVersion: {{ .TLS.MinVersion }} maxVersion: {{ .TLS.MaxVersion }} renegotiation: {{ .TLS.Renegotiation }} defaults.json: ca-url: {{ .Defaults.CaUrl }} ca-config: {{ .Defaults.CaConfig }} fingerprint: {{ .Defaults.Fingerprint }} root: {{ .Defaults.Root }} # Certificates contains the root and intermediate certificate and # optionally the SSH host and user public keys certificates: # intermediate_ca contains the text of the intermediate CA Certificate intermediate_ca: | {{- index .Files .Intermediate | toString | nindent 6 }} # root_ca contains the text of the root CA Certificate root_ca: | {{- first .Root | index .Files | toString | nindent 6 }} {{- if .Ssh }} # ssh_host_ca contains the text of the public ssh key for the SSH root CA ssh_host_ca: {{ index .Files .Ssh.HostPublicKey | toString }} # ssh_user_ca contains the text of the public ssh key for the SSH root CA ssh_user_ca: {{ index .Files .Ssh.UserPublicKey | toString }} {{- end }} # Secrets contains the root and intermediate keys and optionally the SSH # private keys secrets: # ca_password contains the password used to encrypt x509.intermediate_ca_key, ssh.host_ca_key and ssh.user_ca_key # This value must be base64 encoded. ca_password: {{ .Password | b64enc }} provisioner_password: {{ .Password | b64enc}} x509: # intermediate_ca_key contains the contents of your encrypted intermediate CA key intermediate_ca_key: | {{- index .Files .IntermediateKey | toString | nindent 8 }} # root_ca_key contains the contents of your encrypted root CA key # Note that this value can be omitted without impacting the functionality of step-certificates # If supplied, this should be encrypted using a unique password that is not used for encrypting # the intermediate_ca_key, ssh.host_ca_key or ssh.user_ca_key. root_ca_key: | {{- first .RootKey | index .Files | toString | nindent 8 }} {{- if .Ssh }} ssh: # ssh_host_ca_key contains the contents of your encrypted SSH Host CA key host_ca_key: | {{- index .Files .Ssh.HostKey | toString | nindent 8 }} # ssh_user_ca_key contains the contents of your encrypted SSH User CA key user_ca_key: | {{- index .Files .Ssh.UserKey | toString | nindent 8 }} {{- end }} **step ca renew** command renews the given certificate (with a request to the certificate authority) and writes the new certificate to disk - either overwriting or using a new file when the **--out**= flag is used. With the **--daemon** flag the command will periodically update the given certificate. By default, it will renew the certificate before 2/3 of the validity period of the certificate has elapsed. A random jitter is used to avoid multiple instances running at the same time. The amount of time between renewal and certificate expiration can be configured using the **--expires-in** flag, or a fixed period can be set with the **--renew-period** flag. The **--daemon** flag can be combined with **--pid**, **--signal**, or **--exec** to provide certificate reloads on your services. By default, the renew command authenticates to step-ca using mTLS, except when the certificate is expired and renewal after expiry is allowed by the CA. There are scenarios where mTLS is not possible: When step-ca is behind a layer 7 proxy, when the server's leaf certificate EKU is not configured for client authentication, or when the server is a StepCAS RA for an upstream step-ca server. For these scenarios, use **--mtls=false** to force a flow that uses X5C token-based authentication. ## POSITIONAL ARGUMENTS : The certificate in PEM format that we want to renew. : They key file of the certificate. ## EXAMPLES Renew a certificate with the configured CA: ''' $ step ca renew internal.crt internal.key Would you like to overwrite internal.crt [Y/n]: y ''' Renew a certificate without overwriting the previous certificate: ''' $ step ca renew --out renewed.crt internal.crt internal.key ''' Renew a certificate forcing the overwrite of the previous certificate: ''' $ step ca renew --force internal.crt internal.key ''' Renew a certificate using the token flow instead of mTLS: ''' $ step ca renew --mtls=false --force internal.crt internal.key ''' Renew a certificate which key is in a KMS: ''' $ step ca renew \ --kms 'pkcs11:module-path=/usr/local/lib/softhsm/libsofthsm2.so;token=smallstep?pin-value=password' \ pkcs11.crt 'pkcs11:id=4001' ''' Renew a certificate providing the <--ca-url> and <--root> flags: ''' $ step ca renew --ca-url https://ca.smallstep.com:9000 \ --root /path/to/root_ca.crt internal.crt internal.key Would you like to overwrite internal.crt [Y/n]: y ''' Renew skipped because it was too early: ''' $ step ca renew --expires-in 8h internal.crt internal.key certificate not renewed: expires in 10h52m5s ''' Renew the certificate before 2/3 of the validity has passed: ''' $ step ca renew --daemon internal.crt internal.key ''' Renew the certificate before 8 hours and 30m of the expiration time: ''' $ step ca renew --daemon --expires-in 8h30m internal.crt internal.key ''' Renew the certificate every 16h: ''' $ step ca renew --daemon --renew-period 16h internal.crt internal.key ''' Renew the certificate and reload nginx: ''' $ step ca renew --daemon --exec "nginx -s reload" internal.crt internal.key ''' Renew the certificate and convert it to DER: ''' $ step ca renew --daemon --renew-period 16h \ --exec "step certificate format --force --out internal.der internal.crt" \ internal.crt internal.key ''' Renew a certificate using the offline mode, requires the configuration files, certificates, and keys created with **step ca init**: ''' $ step ca renew --offline internal.crt internal.key ''' {{template "Prolog" .}} {{template "StatusTable" .}} {{template "Epilog" .}} {{define "Prolog"}} /debug/requests

/debug/requests

{{end}} {{/* end of Prolog */}} {{define "StatusTable"}} {{range $fam := .Families}} {{$n := index $.ActiveTraceCount $fam}} {{$f := index $.CompletedTraces $fam}} {{range $i, $b := $f.Buckets}} {{$empty := $b.Empty}} {{end}} {{$nb := len $f.Buckets}} {{end}}
{{$fam}} {{if $n}}{{end}} [{{$n}} active] {{if $n}}{{end}} {{if not $empty}}{{end}} [{{.Cond}}] {{if not $empty}}{{end}} [minute] [hour] [total]
{{end}} {{/* end of StatusTable */}} {{define "Epilog"}} {{if $.Traces}}

Family: {{$.Family}}

{{if or $.Expanded $.Traced}} [Normal/Summary] {{else}} [Normal/Summary] {{end}} {{if or (not $.Expanded) $.Traced}} [Normal/Expanded] {{else}} [Normal/Expanded] {{end}} {{if not $.Active}} {{if or $.Expanded (not $.Traced)}} [Traced/Summary] {{else}} [Traced/Summary] {{end}} {{if or (not $.Expanded) (not $.Traced)}} [Traced/Expanded] {{else}} [Traced/Expanded] {{end}} {{end}} {{if $.Total}}

Showing {{len $.Traces}} of {{$.Total}} traces.

{{end}} {{range $tr := $.Traces}} {{/* TODO: include traceID/spanID */}} {{if $.Expanded}} {{range $tr.Events}} {{end}} {{end}} {{end}}
{{if $.Active}}Active{{else}}Completed{{end}} Requests
WhenElapsed (s)
{{$tr.When}} {{$tr.ElapsedTime}} {{$tr.Title}}
{{.WhenString}} {{elapsed .Elapsed}} {{if or $.ShowSensitive (not .Sensitive)}}... {{.What}}{{else}}[redacted]{{end}}
{{end}} {{/* if $.Traces */}} {{if $.Histogram}}

Latency (µs) of {{$.Family}} over {{$.HistogramWindow}}

{{$.Histogram}} {{end}} {{/* if $.Histogram */}} {{end}} {{/* end of Epilog */}} **step crypto jwk create** generates a new JWK (JSON Web Key) or constructs a JWK from an existing key. The generated JWK conforms to RFC7517 and can be used to sign and encrypt data using JWT, JWS, and JWE. Files containing private keys are encrypted by default. You'll be prompted for a password. Keys are written with file mode **0600** (i.e., readable and writable only by the current user). All flags are optional. Defaults are suitable for most use cases. ## POSITIONAL ARGUMENTS : Path to which the public JWK should be written : Path to which the (JWE encrypted) private JWK should be written ## EXIT CODES This command returns 0 on success and \>0 if any error occurs. ## SECURITY CONSIDERATIONS All security considerations from **step help crypto** are relevant here. **Preventing hostile disclosure of non-public key material** : It is critical that any private and symmetric key material be protected from unauthorized disclosure or modification. This includes the private key for asymmetric key types (RSA, EC, and OKP) and the shared secret for symmetric key types (oct). One means of protection is encryption. Keys can also be stored in hardware or software "security enclaves" such as HSMs and TPMs or operating system keychain management tools. **Key provenance and bindings** : Key provenance should always be scrutinized. You should not trust a key that was obtained in an untrustworthy manner (e.g., non-TLS HTTP). : Usually applications use keys to make authorization decisions based on attributes "bound" to the key such as the key owner's name or role. In these scenarios the strength of the system's security depends on the strength of these "bindings". There are a variety of mechanisms for securely binding attributes to keys, including: * Cryptographically binding attributes to the public key using x509 certificates (e.g., as defined in PKIX / RFC2580) * Cryptographically binding attributes to the public key using JWTs * Storing the public key or (hashed) shared secret along with the bound attributes in a secure database : Cryptographic mechanisms require establishing a "root of trust" that can sign the bindings (the certificates or JWTs) asserting that the bound attributes are correct. ## STANDARDS [RFC7517] : Jones, M., "JSON Web Key (JWK)", https://tools.ietf.org/html/rfc7517 [RFC7518] : Jones, M., "JSON Web Algorithms (JWA)", https://tools.ietf.org/html/rfc7518 [RFC7638] : M. Jones, N. Sakimura., "JSON Web Key (JWK) Thumbprint", https://tools.ietf.org/html/rfc7638 [RFC8037] : I. Liusvaara., "CFRG Elliptic Curve Diffie-Hellman (ECDH) and Signatures in JSON Object Signing and Encryption (JOSE)", https://tools.ietf.org/html/rfc8037 ## EXAMPLES Create a new JWK using default options: ''' $ step crypto jwk create jwk.pub.json jwk.json ''' Create an RSA JWK: ''' $ step crypto jwk create rsa.pub.json rsa.json --kty RSA ''' Create a symmetric key (oct key type): ''' $ step crypto jwk create oct.pub.json oct.json --kty oct ''' Create a key for use with the Ed25519 cryptosystem: ''' $ step crypto jwk create ed.pub.json ed.json \ --kty OKP --crv Ed25519 ''' Create a key from an existing PEM file: ''' $ step crypto jwk create jwk.pub.json jwk.json \ --from-pem key.pem ''' Create an 4096 bit RSA encryption key: ''' $ step crypto jwk create rsa-enc.pub.json rsa-enc.json \ --kty RSA --size 4096 --use enc ''' Create a 192 bit symmetric encryption key for use with AES Key Wrap: ''' $ step crypto jwk create kw.pub.json kw.json \ --kty oct --size 192 --use enc --alg A192GCMKW ''' **step ssh certificate** command generates an SSH key pair and creates a certificate using [step certificates](https://github.com/smallstep/certificates). With a certificate clients or servers may trust only the CA key and verify its signature on a certificate rather than trusting many user/host keys. Note that not all the provisioner types will be able to generate user and host certificates. Currently JWK provisioners can generate both, but with an OIDC provisioner you will only be able to generate user certificates unless you are and admin that can generate both. With a cloud identity provisioner you will only be able to generate host certificates. To configure a server to accept user certificates and provide a user certificate you need to add the following lines in : ''' # The path to the CA public key, it accepts multiple user CAs, one per line TrustedUserCAKeys /etc/ssh/ssh_user_key.pub # Path to the private key and certificate HostKey /etc/ssh/ssh_host_ecdsa_key HostCertificate /etc/ssh/ssh_host_ecdsa_key-cert.pub ''' Make sure to restart the sshd daemon to refresh its configuration. To configure clients to accept host certificates you need to add the host CA public key in <~/.ssh/known_hosts> with the following format: ''' @cert-authority *.example.com ecdsa-sha2-nistp256 AAAAE...= ''' Where <*.example.com> is a pattern that matches the hosts and should be the contents of the host CA public key. ## POSITIONAL ARGUMENTS : The certificate identity. If no principals are passed we will use the key-id as a principal, if it has the format abc@def then the principal will be abc. : The private key name when generating a new key pair, or the public key path when we are just signing it. ## EXAMPLES Generate a new SSH key pair and user certificate: ''' $ step ssh certificate mariano@work id_ecdsa ''' Generate a new SSH key pair and user certificate and do not add to SSH agent: ''' $ step ssh certificate mariano@work id_ecdsa --no-agent ''' Generate a new SSH key pair and user certificate and set the lifetime to 2hrs: ''' $ step ssh certificate mariano@work id_ecdsa --not-after 2h ''' Generate a new SSH key pair and user certificate and set the lifetime to begin 2hrs from now and last for 8hrs: ''' $ step ssh certificate mariano@work id_ecdsa --not-before 2h --not-after 10h ''' Sign an SSH public key and generate a user certificate: ''' $ step ssh certificate --sign mariano@work id_ecdsa.pub ''' Generate a new SSH key pair and host certificate: ''' $ step ssh certificate --host internal.example.com ssh_host_ecdsa_key ''' Sign an SSH public key and generate a host certificate: ''' $ step ssh certificate --host --sign \ internal.example.com ssh_host_ecdsa_key.pub ''' Sign an SSH public key and generate a host certificate with a custom uuid: ''' $ step ssh certificate --host --host-id 00000000-0000-0000-0000-000000000000 \ --sign internal.example.com ssh_host_ecdsa_key.pub ''' Sign an SSH public key and generate a host certificate with a uuid derived from '/etc/machine-id': ''' $ step ssh certificate --host --host-id machine --sign \ internal.example.com ssh_host_ecdsa_key.pub ''' Generate an ssh certificate with custom principals from an existing key pair and add the certificate to the ssh agent: ''' $ step ssh certificate --principal max --principal mariano --sign \ ops@work id_ecdsa.pub --private-key id_ecdsa_key ''' Generate a new key pair and a certificate using a given token: ''' $ step ssh certificate --token $TOKEN mariano@work id_ecdsa ''' Create an EC pair with curve P-521 and certificate: ''' $ step ssh certificate --kty EC --curve "P-521" mariano@work id_ecdsa ''' Create an Octet Key Pair with curve Ed25519 and certificate: ''' $ step ssh certificate --kty OKP --curve Ed25519 mariano@work id_ed25519 '''**step ca provisioner update** [**--public-key**=] [**--private-key**=] [**--create**] [**--password-file**=] [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] [**--x509-template**=] [**--x509-template-data**=] [**--ssh-template**=] [**--ssh-template-data**=] ACME **step ca provisioner update** [**--force-cn**] [**--require-eab**] [**--challenge**=] [**--remove-challenge**=] [**--attestation-format**=] [**--remove-attestation-format**=] [**--attestation-roots**=] [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] [**--x509-template**=] [**--x509-template-data**=] OIDC **step ca provisioner update** [**--client-id**=] [**--client-secret**=] [**--configuration-endpoint**=] [**--listen-address=
] [**--domain**=] [**--remove-domain**=] [**--group**=] [**--remove-group**=] [**--admin**=]... [**--remove-admin**=]... [**--scope**=] [**--remove-scope**=] [**--auth-param**=] [**--remove-auth-param**=] [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] [**--x509-template**=] [**--x509-template-data**=] [**--ssh-template**=] [**--ssh-template-data**=] X5C **step ca provisioner update** **--x5c-roots**= [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] [**--x509-template**=] [**--x509-template-data**=] [**--ssh-template**=] [**--ssh-template-data**=] K8SSA (Kubernetes Service Account) **step ca provisioner update** [**--public-key**=] [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] [**--x509-template**=] [**--x509-template-data**=] IID (AWS/GCP/Azure) **step ca provisioner update** [**--aws-account**=]... [**--remove-aws-account**=]... [**--gcp-service-account**=]... [**--remove-gcp-service-account**=]... [**--gcp-project**=]... [**--remove-gcp-project**=]... [**--gcp-organization**=] [**--azure-tenant**=] [**--azure-resource-group**=] [**--azure-audience**=] [**--azure-subscription-id**=] [**--azure-object-id**=] [**--instance-age**=] [**--disable-custom-sans**] [**--disable-trust-on-first-use**] [**--disable-ssh-ca-user**] [**--disable-ssh-ca-host**] [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] [**--x509-template**=] [**--x509-template-data**=] [**--ssh-template**=] [**--ssh-template-data**=] SCEP **step ca provisioner update** [**--force-cn**] [**--challenge**=] [**--capabilities**=] [**--include-root**] [**--exclude-intermediate**] [**--minimum-public-key-length**=] [**--encryption-algorithm-identifier**=] [**--scep-decrypter-certificate-file**=] [**--scep-decrypter-key-file**=] [**--scep-decrypter-key-uri**=] [**--scep-decrypter-key-password-file**=] [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] [**--x509-template**=] [**--x509-template-data**=]**step ca certificate** command generates a new certificate pair ## POSITIONAL ARGUMENTS : The Common Name, DNS Name, or IP address that will be set as the Subject Common Name for the certificate. If no Subject Alternative Names (SANs) are configured (via the --san flag) then the will be set as the only SAN. : File to write the certificate (PEM format) : File to write the private key (PEM format) ## EXAMPLES Request a new certificate for a given domain. There are no additional SANs configured, therefore (by default) the will be used as the only SAN extension: DNS Name internal.example.com: ''' $ TOKEN=$(step ca token internal.example.com) $ step ca certificate --token $TOKEN internal.example.com internal.crt internal.key ''' Request a new certificate with multiple Subject Alternative Names. The Subject Common Name of the certificate will be 'foobar'. However, because additional SANs are configured using the --san flag and 'foobar' is not one of these, 'foobar' will not be in the SAN extensions of the certificate. The certificate will have 2 IP Address extensions (1.1.1.1, 10.2.3.4) and 1 DNS Name extension (hello.example.com): ''' $ step ca certificate --san 1.1.1.1 --san hello.example.com --san 10.2.3.4 foobar internal.crt internal.key ''' Request a new certificate with a 1h validity: ''' $ TOKEN=$(step ca token internal.example.com) $ step ca certificate --token $TOKEN --not-after=1h internal.example.com internal.crt internal.key ''' Request a new certificate using the offline mode, requires the configuration files, certificates, and keys created with **step ca init**: ''' $ step ca certificate --offline internal.example.com internal.crt internal.key ''' Request a new certificate using the offline mode with additional flags to avoid console prompts: ''' $ step ca certificate --offline \ --password-file ./pass.txt \ --provisioner foo \ --provisioner-password-file ./provisioner-pass.txt \ internal.example.com internal.crt internal.key ''' Request a new certificate using an OIDC provisioner: ''' $ step ca certificate --token $(step oauth --oidc --bare) joe@example.com joe.crt joe.key ''' Request a new certificate using an OIDC provisioner while remaining in the console: ''' $ step ca certificate joe@example.com joe.crt joe.key --issuer Google --console ''' Request a new certificate with an RSA public key (default is ECDSA256): ''' $ step ca certificate foo.internal foo.crt foo.key --kty RSA --size 4096 ''' Request a new certificate with an X5C provisioner: ''' $ step ca certificate foo.internal foo.crt foo.key --x5c-cert x5c.cert --x5c-key x5c.key ''' **Certificate Templates** - With a provisioner configured with a custom template we can use the **--set** flag to pass user variables: ''' $ step ca certificate foo.internal foo.crt foo.key --set emailAddresses=root@internal.com $ step ca certificate foo.internal foo.crt foo.key --set emailAddresses='["foo@internal.com","root@internal.com"]' ''' Or you can pass them from a file using **--set-file**: ''' $ cat path/to/data.json { "emailAddresses": ["foo@internal.com","root@internal.com"] } $ step ca certificate foo.internal foo.crt foo.key --set-file path/to/data.json ''' **step CA ACME** - In order to use the step CA ACME protocol you must add a ACME provisioner to the step CA config. See **step ca provisioner add -h**. Request a new certificate using the step CA ACME server and a standalone server to serve the challenges locally (standalone mode is the default): ''' $ step ca certificate foobar foo.crt foo.key --provisioner my-acme-provisioner --san foo.internal --san bar.internal ''' Request a new certificate using the step CA ACME server and an existing server along with webroot mode to serve the challenges locally: ''' $ step ca certificate foobar foo.crt foo.key --provisioner my-acme-provisioner --webroot "./acme-www" \ --san foo.internal --san bar.internal ''' Request a new certificate using the ACME protocol not served via the step CA (e.g. letsencrypt). NOTE: Let's Encrypt requires that the Subject Common Name of a requested certificate be validated as an Identifier in the ACME order along with any other SANS. Therefore, the Common Name must be a valid DNS Name. The step CA does not impose this requirement. ''' $ step ca certificate foo.internal foo.crt foo.key \ --acme https://acme-staging-v02.api.letsencrypt.org/directory --san bar.internal '''**step ca provisioner add** **--type**=JWK [**--public-key**=] [**--private-key**=] [**--create**] [**--password-file**=] [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] [**--x509-template**=] [**--x509-template-data**=] [**--ssh-template**=] [**--ssh-template-data**=] ACME **step ca provisioner add** **--type**=ACME [**--force-cn**] [**--require-eab**] [**--challenge**=] [**--attestation-format**=] [**--attestation-roots**=] [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] [**--x509-template**=] [**--x509-template-data**=] OIDC **step ca provisioner add** **--type**=OIDC [**--client-id**=] [**--client-secret**=] [**--configuration-endpoint**=] [**--domain**=] [**--admin**=]... [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] [**--x509-template**=] [**--x509-template-data**=] [**--ssh-template**=] [**--ssh-template-data**=] X5C **step ca provisioner add** **--type**=X5C **--x5c-roots**= [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] [**--x509-template**=] [**--x509-template-data**=] [**--ssh-template**=] [**--ssh-template-data**=] SSHPOP **step ca provisioner add** **--type**=SSHPOP [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] Nebula **step ca provisioner add** **--type**=Nebula **--nebula-root**= [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] K8SSA (Kubernetes Service Account) **step ca provisioner add** **--type**=K8SSA [**--public-key**=] [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] [**--x509-template**=] [**--x509-template-data**=] IID (AWS/GCP/Azure) **step ca provisioner add** **--type**=[AWS|Azure|GCP] [**--aws-account**=] [**--gcp-service-account**=] [**--gcp-project**=] [**--gcp-organization**=] [**--azure-tenant**=] [**--azure-resource-group**=] [**--azure-audience**=] [**--azure-subscription-id**=] [**--azure-object-id**=] [**--instance-age**=] [**--iid-roots**=] [**--disable-custom-sans**] [**--disable-trust-on-first-use**] [**--disable-ssh-ca-user**] [**--disable-ssh-ca-host**] [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] [**--x509-template**=] [**--x509-template-data**=] [**--ssh-template**=] [**--ssh-template-data**=] SCEP **step ca provisioner add** **--type**=SCEP [**--force-cn**] [**--challenge**=] [**--capabilities**=] [**--include-root**] [**--exclude-intermediate**] [**--min-public-key-length**=] [**--encryption-algorithm-identifier**=] [**--scep-decrypter-certificate-file**=] [**--scep-decrypter-key-file**=] [**--scep-decrypter-key-uri**=] [**--scep-decrypter-key-password-file**=] [**--admin-cert**=] [**--admin-key**=] [**--admin-subject**=] [**--admin-provisioner**=] [**--admin-password-file**=] [**--ca-url**=] [**--root**=] [**--context**=] [**--ca-config**=] [**--x509-template**=] [**--x509-template-data**=]