Skip to content

Commit 5869606

Browse files
author
Jan Sternagel
committed
better examples
1 parent eae8ec2 commit 5869606

File tree

6 files changed

+48
-18
lines changed

6 files changed

+48
-18
lines changed

docs/stackit_beta_kms_key_create.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,23 @@ stackit beta kms key create [flags]
1313
### Examples
1414

1515
```
16-
Create a Symmetric KMS key
17-
$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "rsa_2048_oaep_sha256" --name "my-key-name" --purpose "asymmetric_encrypt_decrypt" --protection "software"
16+
Create a symmetric AES key (AES-256) with the name "symm-aes-gcm" under the key ring "MY_KEYRING_ID"
17+
$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "aes_256_gcm" --name "symm-aes-gcm" --purpose "symmetric_encrypt_decrypt" --protection "software"
1818
19-
Create a Message Authentication KMS key
20-
$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "hmac_sha512" --name "my-key-name" --purpose "message_authentication_code" --protection "software"
19+
Create an asymmetric RSA encryption key (RSA-2048)
20+
$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "rsa_2048_oaep_sha256" --name "prod-orders-rsa" --purpose "asymmetric_encrypt_decrypt" --protection "software"
21+
22+
Create a message authentication key (HMAC-SHA512)
23+
$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "hmac_sha512" --name "api-mac-key" --purpose "message_authentication_code" --protection "software"
24+
25+
Create an ECDSA P-256 key for signing & verification
26+
$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "ecdsa_p256_sha256" --name "signing-ecdsa-p256" --purpose "asymmetric_sign_verify" --protection "software"
27+
28+
Create an import-only key (versions must be imported)
29+
$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "rsa_2048_oaep_sha256" --name "ext-managed-rsa" --purpose "asymmetric_encrypt_decrypt" --protection "software" --import-only
30+
31+
Create a key and print the result as YAML
32+
$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "rsa_2048_oaep_sha256" --name "yaml-output-rsa" --purpose "asymmetric_encrypt_decrypt" --protection "software" --output yaml
2133
```
2234

2335
### Options

docs/stackit_beta_kms_keyring_create.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ stackit beta kms keyring create [flags]
1313
### Examples
1414

1515
```
16-
Create a KMS key ring
16+
Create a KMS key ring with name "my-keyring"
1717
$ stackit beta kms keyring create --name my-keyring
1818
1919
Create a KMS key ring with a description
2020
$ stackit beta kms keyring create --name my-keyring --description my-description
21+
22+
Create a KMS key ring and print the result as YAML
23+
$ stackit beta kms keyring create --name my-keyring -o yaml
2124
```
2225

2326
### Options

docs/stackit_beta_kms_wrapping-key_create.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ stackit beta kms wrapping-key create [flags]
1313
### Examples
1414

1515
```
16-
Create a Symmetric KMS wrapping key
17-
$ stackit beta kms wrapping-key create --keyring-id "MY_KEYRING_ID" --algorithm "rsa_2048_oaep_sha256" --name "my-wrapping-key-name" --purpose "wrap_asymmetric_key" --protection "software"
16+
Create a symmetric (RSA + AES) KMS wrapping key with name "my-wrapping-key-name" in keyring with ID "MY_KEYRING_ID"
17+
$ stackit beta kms wrapping-key create --keyring-id "MY_KEYRING_ID" --algorithm "rsa_2048_oaep_sha256_aes_256_key_wrap" --name "my-wrapping-key-name" --purpose "wrap_symmetric_key" --protection "software"
1818
19-
Create an Asymmetric KMS wrapping key with a description
20-
$ stackit beta kms wrapping-key create --keyring-id "MY_KEYRING_ID" --algorithm "hmac_sha256" --name "my-wrapping-key-name" --description "my-description" --purpose "wrap_asymmetric_key" --protection "software"
19+
Create an asymmetric (RSA) KMS wrapping key with name "my-wrapping-key-name" in keyring with ID "MY_KEYRING_ID"
20+
$ stackit beta kms wrapping-key create --keyring-id "MY_KEYRING_ID" --algorithm "rsa_3072_oaep_sha256" --name "my-wrapping-key-name" --purpose "wrap_asymmetric_key" --protection "software"
2121
```
2222

2323
### Options

internal/cmd/beta/kms/key/create/create.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,23 @@ func NewCmd(params *params.CmdParams) *cobra.Command {
5353
Args: args.NoArgs,
5454
Example: examples.Build(
5555
examples.NewExample(
56-
`Create a Symmetric KMS key`,
57-
`$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "rsa_2048_oaep_sha256" --name "my-key-name" --purpose "asymmetric_encrypt_decrypt" --protection "software"`),
56+
`Create a symmetric AES key (AES-256) with the name "symm-aes-gcm" under the key ring "MY_KEYRING_ID"`,
57+
`$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "aes_256_gcm" --name "symm-aes-gcm" --purpose "symmetric_encrypt_decrypt" --protection "software"`),
5858
examples.NewExample(
59-
`Create a Message Authentication KMS key`,
60-
`$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "hmac_sha512" --name "my-key-name" --purpose "message_authentication_code" --protection "software"`),
59+
`Create an asymmetric RSA encryption key (RSA-2048)`,
60+
`$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "rsa_2048_oaep_sha256" --name "prod-orders-rsa" --purpose "asymmetric_encrypt_decrypt" --protection "software"`),
61+
examples.NewExample(
62+
`Create a message authentication key (HMAC-SHA512)`,
63+
`$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "hmac_sha512" --name "api-mac-key" --purpose "message_authentication_code" --protection "software"`),
64+
examples.NewExample(
65+
`Create an ECDSA P-256 key for signing & verification`,
66+
`$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "ecdsa_p256_sha256" --name "signing-ecdsa-p256" --purpose "asymmetric_sign_verify" --protection "software"`),
67+
examples.NewExample(
68+
`Create an import-only key (versions must be imported)`,
69+
`$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "rsa_2048_oaep_sha256" --name "ext-managed-rsa" --purpose "asymmetric_encrypt_decrypt" --protection "software" --import-only`),
70+
examples.NewExample(
71+
`Create a key and print the result as YAML`,
72+
`$ stackit beta kms key create --keyring-id "MY_KEYRING_ID" --algorithm "rsa_2048_oaep_sha256" --name "yaml-output-rsa" --purpose "asymmetric_encrypt_decrypt" --protection "software" --output yaml`),
6173
),
6274
RunE: func(cmd *cobra.Command, _ []string) error {
6375
ctx := context.Background()

internal/cmd/beta/kms/keyring/create/create.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ func NewCmd(params *params.CmdParams) *cobra.Command {
4141
Args: args.NoArgs,
4242
Example: examples.Build(
4343
examples.NewExample(
44-
`Create a KMS key ring`,
44+
`Create a KMS key ring with name "my-keyring"`,
4545
"$ stackit beta kms keyring create --name my-keyring"),
4646
examples.NewExample(
4747
`Create a KMS key ring with a description`,
4848
"$ stackit beta kms keyring create --name my-keyring --description my-description"),
49+
examples.NewExample(
50+
`Create a KMS key ring and print the result as YAML`,
51+
"$ stackit beta kms keyring create --name my-keyring -o yaml"),
4952
),
5053
RunE: func(cmd *cobra.Command, _ []string) error {
5154
ctx := context.Background()

internal/cmd/beta/kms/wrappingkey/create/create.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ func NewCmd(params *params.CmdParams) *cobra.Command {
5151
Args: args.NoArgs,
5252
Example: examples.Build(
5353
examples.NewExample(
54-
`Create a Symmetric KMS wrapping key`,
55-
`$ stackit beta kms wrapping-key create --keyring-id "MY_KEYRING_ID" --algorithm "rsa_2048_oaep_sha256" --name "my-wrapping-key-name" --purpose "wrap_asymmetric_key" --protection "software"`),
54+
`Create a symmetric (RSA + AES) KMS wrapping key with name "my-wrapping-key-name" in keyring with ID "MY_KEYRING_ID"`,
55+
`$ stackit beta kms wrapping-key create --keyring-id "MY_KEYRING_ID" --algorithm "rsa_2048_oaep_sha256_aes_256_key_wrap" --name "my-wrapping-key-name" --purpose "wrap_symmetric_key" --protection "software"`),
5656
examples.NewExample(
57-
`Create an Asymmetric KMS wrapping key with a description`,
58-
`$ stackit beta kms wrapping-key create --keyring-id "MY_KEYRING_ID" --algorithm "hmac_sha256" --name "my-wrapping-key-name" --description "my-description" --purpose "wrap_asymmetric_key" --protection "software"`),
57+
`Create an asymmetric (RSA) KMS wrapping key with name "my-wrapping-key-name" in keyring with ID "MY_KEYRING_ID"`,
58+
`$ stackit beta kms wrapping-key create --keyring-id "MY_KEYRING_ID" --algorithm "rsa_3072_oaep_sha256" --name "my-wrapping-key-name" --purpose "wrap_asymmetric_key" --protection "software"`),
5959
),
6060
RunE: func(cmd *cobra.Command, _ []string) error {
6161
ctx := context.Background()

0 commit comments

Comments
 (0)