Skip to content

Commit ed52b93

Browse files
tashianclaude
andcommitted
Simplify KMS examples to use auto-detection
Update cryptographic-protection.mdx examples to show the simplified syntax where KMS URIs can be used directly without the --kms flag. The step CLI now auto-detects KMS URIs by their scheme prefix (cloudkms:, awskms:, yubikey:, tpmkms:, pkcs11:), so the --kms flag is optional in many cases. Related: smallstep/cli#1560 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 221d593 commit ed52b93

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

step-ca/cryptographic-protection.mdx

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Cryptographic Protection
33
html_title: Secure Cryptographic Key Protection Methods
44
description: Secure private keys in step-ca deployments. Hardware security modules, key management, and cryptographic best practices for enterprise PKI.
5-
updated_at: September 17, 2025
5+
updated_at: February 02, 2026
66
---
77

88
By default, `step-ca` stores its signing keys encrypted on disk.
@@ -74,11 +74,12 @@ Now, let's sign a root CA certificate based on the the key you just created. Sub
7474

7575
```shell nocopy
7676
$ step certificate create --profile root-ca \
77-
--kms 'cloudkms:' \
78-
--key 'projects/smallstep/locations/global/keyRings/step-ca/cryptoKeys/root/cryptoKeyVersions/1' \
77+
--key 'cloudkms:projects/smallstep/locations/global/keyRings/step-ca/cryptoKeys/root/cryptoKeyVersions/1' \
7978
"Smallstep Root CA" root_ca.crt
8079
```
8180

81+
The `step` CLI automatically detects Cloud KMS URIs, so the `--kms` flag is optional when the key URI includes the `cloudkms:` prefix.
82+
8283
Output:
8384

8485
```
@@ -91,11 +92,10 @@ Great. Next, repeat the process for the Intermediate CA:
9192
$ step kms create --json --kms 'cloudkms:' \
9293
'projects/smallstep/locations/global/keyRings/step-ca/cryptoKeys/intermediate'
9394
$ step certificate create --profile intermediate-ca \
94-
--kms 'cloudkms:' \
9595
--ca-kms 'cloudkms:' \
9696
--ca root_ca.crt \
9797
--ca-key 'projects/smallstep/locations/global/keyRings/step-ca/cryptoKeys/root/cryptoKeyVersions/1' \
98-
--key 'projects/smallstep/locations/global/keyRings/step-ca/cryptoKeys/intermediate/cryptoKeyVersions/1' \
98+
--key 'cloudkms:projects/smallstep/locations/global/keyRings/step-ca/cryptoKeys/intermediate/cryptoKeyVersions/1' \
9999
"Smallstep Intermediate CA" intermediate_ca.crt
100100
```
101101

@@ -230,11 +230,12 @@ Now, let's sign a root CA certificate based on the the key you just created. Sub
230230

231231
```shell nocopy
232232
$ step certificate create --profile root-ca \
233-
--kms 'awskms:region=us-east-2' \
234-
--key 'awskms:key-id=78980acd-a42d-4d84-97ba-1e50d3082214' \
233+
--key 'awskms:region=us-east-2;key-id=78980acd-a42d-4d84-97ba-1e50d3082214' \
235234
"Smallstep Root CA" root_ca.crt
236235
```
237236

237+
The `step` CLI automatically detects AWS KMS URIs, so the `--kms` flag is optional when the key URI includes the `awskms:` prefix. The region can be included in the key URI.
238+
238239
Output:
239240

240241
```
@@ -246,11 +247,10 @@ Great. Next, we'll repeat the process for the Intermediate CA:
246247
```shell nocopy
247248
$ step kms create --json --kms 'awskms:region=us-east-2' intermediate-ca
248249
$ step certificate create --profile intermediate-ca \
249-
--kms 'awskms:region=us-east-2' \
250250
--ca-kms 'awskms:region=us-east-2' \
251251
--ca root_ca.crt \
252252
--ca-key 'awskms:key-id=78980acd-a42d-4d84-97ba-1e50d3082214' \
253-
--key 'awskms:key-id=9432458d-1e67-4a74-9a23-8f94708b45fe' \
253+
--key 'awskms:region=us-east-2;key-id=9432458d-1e67-4a74-9a23-8f94708b45fe' \
254254
"Smallstep Intermediate CA" intermediate_ca.crt
255255
```
256256

@@ -483,7 +483,7 @@ Now, let's sign a root CA certificate based on the the key you just created. Sub
483483

484484
```shell nocopy
485485
$ step certificate create --profile root-ca \
486-
--kms "$PKCS_URI"
486+
--kms "$PKCS_URI" \
487487
--key "pkcs11:id=7331;object=root-ca" \
488488
"Smallstep Root CA" root_ca.crt
489489
```
@@ -494,12 +494,17 @@ Output:
494494
Your certificate has been saved in root_ca.crt.
495495
```
496496

497+
<Alert severity="info">
498+
<div>
499+
The `--kms` flag is optional if you include the full PKCS #11 URI (with module-path, token, and PIN) in the `--key` argument. However, using `--kms` keeps the key identifier shorter and avoids repeating connection details across multiple commands.
500+
</div>
501+
</Alert>
502+
497503
Great. Next, we'll repeat the process for the Intermediate CA:
498504

499505
```shell nocopy
500506
$ step kms create --json --kms "$PKCS_URI" "pkcs11:id=7332;object=intermediate-ca"
501507
$ step certificate create --profile intermediate-ca \
502-
--kms "$PKCS_URI" \
503508
--ca-kms "$PKCS_URI" \
504509
--ca root_ca.crt \
505510
--ca-key "pkcs11:id=7331;object=root-ca" \
@@ -626,14 +631,14 @@ and sign an Intermediate CA certificate:
626631
```shell nocopy
627632
$ step kms create --json 'tpmkms:name=my-intermediate-ca'
628633
$ step certificate create --profile intermediate-ca \
629-
--kms 'tpmkms:' \
630634
--ca root_ca.crt \
631635
--ca-key root_ca.key \
632636
--key 'tpmkms:name=my-intermediate-ca' \
633637
"Smallstep Intermediate CA" intermediate_ca.crt
634638
```
635639

636640
Here, the `--ca-key` is your root CA; the `--key` is the intermediate CA key id.
641+
The `step` CLI automatically detects TPM KMS URIs, so the `--kms` flag is optional.
637642

638643
Output:
639644

@@ -725,12 +730,12 @@ Now, let's sign a root CA certificate based on the the key you just created. Sub
725730

726731
```shell nocopy
727732
$ step certificate create --profile root-ca \
728-
--kms 'yubikey:pin-value=123456' \
729-
--key 'yubikey:slot-id=82' \
733+
--key 'yubikey:slot-id=82?pin-value=123456' \
730734
"Smallstep Root CA" root_ca.crt
731735
```
732736

733737
Here we're using the default PIN code of 123456 to access the YubiKey.
738+
The `step` CLI automatically detects YubiKey URIs, so the `--kms` flag is optional when the PIN is included in the key URI.
734739

735740
Output:
736741

@@ -743,11 +748,10 @@ Great. Next, we'll repeat the process for the Intermediate CA:
743748
```shell nocopy
744749
$ step kms create --json 'yubikey:slot-id=83'
745750
$ step certificate create --profile intermediate-ca \
746-
--kms 'yubikey:pin-value=123456' \
747751
--ca-kms 'yubikey:pin-value=123456' \
748752
--ca root_ca.crt \
749753
--ca-key 'yubikey:slot-id=82' \
750-
--key 'yubikey:slot-id=83' \
754+
--key 'yubikey:slot-id=83?pin-value=123456' \
751755
"Smallstep Intermediate CA" intermediate_ca.crt
752756
```
753757

0 commit comments

Comments
 (0)