@@ -41,14 +41,15 @@ func createCommand() cli.Command {
4141 Action : command .ActionFunc (createAction ),
4242 Usage : "create a certificate or certificate signing request" ,
4343 UsageText : `**step certificate create** <subject> <crt-file> <key-file>
44- [**--kms**=<uri>] [**--csr**] [**--profile**=<profile>]
45- [**--template**=<file>] [**--set**=<key=value>] [**--set-file**=<file>]
46- [**--not-before**=<duration>] [**--not-after**=<duration>]
47- [**--password-file**=<file>] [**--ca**=<issuer-cert>]
48- [**--ca-key**=<issuer-key>] [**--ca-password-file**=<file>]
49- [**--ca-kms**=<uri>] [**--san**=<SAN>] [**--bundle**] [**--key**=<file>]
5044[**--kty**=<type>] [**--curve**=<curve>] [**--size**=<size>]
51- [**--skip-csr-signature**] [**--no-password**] [**--insecure**]` ,
45+ [**--csr**] [**--profile**=<profile>] [**--template**=<file>]
46+ [**--set**=<key=value>] [**--set-file**=<file>]
47+ [**--not-before**=<duration>] [**--not-after**=<duration>] [**--san**=<SAN>]
48+ [**--ca**=<issuer-cert>] [**--ca-kms**=<uri>]
49+ [**--ca-key**=<issuer-key>] [**--ca-password-file**=<file>]
50+ [**--kms**=<uri>] [**--key**=<file>] [**--password-file**=<file>]
51+ [**--bundle**] [**--skip-csr-signature**]
52+ [**--no-password**] [**--subtle**] [**--insecure**]` ,
5253 Description : `**step certificate create** generates a certificate or a
5354certificate signing request (CSR) that can be signed later using 'step
5455certificate sign' (or some other tool) to produce a certificate.
@@ -347,35 +348,37 @@ $ step certificate create \
347348 --profile intermediate-ca \
348349 --ca-kms 'pkcs11:module-path=/usr/local/lib/softhsm/libsofthsm2.so;token=smallstep?pin-value=password'
349350 --ca root_ca.crt --ca-key 'pkcs11:id=4000' \
350- --kms 'pkcs11:module-path=/usr/local/lib/softhsm/libsofthsm2.so;token=smallstep?pin-value=password' \
351+ --kms 'pkcs11:module-path=/usr/local/lib/softhsm/libsofthsm2.so;token=smallstep?pin-value=password' \
351352 --key 'pkcs11:id=4001' \
352353 'My KMS Intermediate' intermediate_ca.crt
353354'''
354355
355356Create an intermediate certificate for an RSA decryption key in Google Cloud KMS, signed by a root stored on disk, using <step-kms-plugin>:
356357'''
357358$ step certificate create \
358- --profile intermediate-ca \
359- --ca root_ca.crt --ca-key root_ca_key \
360- --kms cloudkms: \
359+ --profile intermediate-ca \
360+ --ca root_ca.crt --ca-key root_ca_key \
361+ --kms cloudkms: \
361362 --key 'projects/myProjectID/locations/global/keyRings/myKeyRing/cryptoKeys/myKey/cryptoKeyVersions/1' \
362363 --skip-csr-signature \
363- 'My RSA Intermediate' intermediate_rsa_ca.crt
364+ 'My RSA Intermediate' intermediate_rsa_ca.crt
364365'''
365366
366367Create an intermediate certificate for an RSA signing key in Google Cloud KMS, signed by a root stored in an HSM, using <step-kms-plugin>:
367368'''
368369$ step certificate create \
369- --profile intermediate-ca \
370+ --profile intermediate-ca \
370371 --ca-kms 'pkcs11:module-path=/usr/local/lib/softhsm/libsofthsm2.so;token=smallstep?pin-value=password' \
371- --ca root_ca.crt --ca-key 'pkcs11:id=4000' \
372- --kms cloudkms: \
372+ --ca root_ca.crt --ca-key 'pkcs11:id=4000' \
373+ --kms cloudkms: \
373374 --key 'projects/myProjectID/locations/global/keyRings/myKeyRing/cryptoKeys/myKey/cryptoKeyVersions/1' \
374- 'My RSA Intermediate' intermediate_rsa_ca.crt
375+ 'My RSA Intermediate' intermediate_rsa_ca.crt
375376'''
376377` ,
377378 Flags : []cli.Flag {
378- flags .KMSUri ,
379+ flags .KTY ,
380+ flags .Size ,
381+ flags .Curve ,
379382 cli.BoolFlag {
380383 Name : "csr" ,
381384 Usage : `Generate a certificate signing request (CSR) instead of a certificate.` ,
@@ -407,14 +410,34 @@ $ step certificate create \
407410 flags .TemplateSet ,
408411 flags .TemplateSetFile ,
409412 cli.StringFlag {
410- Name : "password-file" ,
411- Usage : `The path to the <file> containing the password to
412- encrypt the new private key or decrypt the user submitted private key.` ,
413+ Name : "not-before" ,
414+ Usage : `The <time|duration> set in the NotBefore property of the certificate. If a
415+ <time> is used it is expected to be in RFC 3339 format. If a <duration> is
416+ used, it is a sequence of decimal numbers, each with optional fraction and a
417+ unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns",
418+ "us" (or "µs"), "ms", "s", "m", "h".` ,
419+ },
420+ cli.StringFlag {
421+ Name : "not-after" ,
422+ Usage : `The <time|duration> set in the NotAfter property of the certificate. If a
423+ <time> is used it is expected to be in RFC 3339 format. If a <duration> is
424+ used, it is a sequence of decimal numbers, each with optional fraction and a
425+ unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns",
426+ "us" (or "µs"), "ms", "s", "m", "h".` ,
427+ },
428+ cli.StringSliceFlag {
429+ Name : "san" ,
430+ Usage : `Add DNS or IP Address Subjective Alternative Names (SANs). Use the '--san'
431+ flag multiple times to configure multiple SANs.` ,
413432 },
414433 cli.StringFlag {
415434 Name : "ca" ,
416435 Usage : `The certificate authority used to issue the new certificate (PEM file).` ,
417436 },
437+ cli.StringFlag {
438+ Name : "ca-kms" ,
439+ Usage : "The <uri> to configure the KMS used for signing the certificate" ,
440+ },
418441 cli.StringFlag {
419442 Name : "ca-key" ,
420443 Usage : `The certificate authority private key used to sign the new certificate (PEM file).` ,
@@ -424,59 +447,34 @@ encrypt the new private key or decrypt the user submitted private key.`,
424447 Usage : `The path to the <file> containing the password to
425448decrypt the CA private key.` ,
426449 },
450+ flags .KMSUri ,
427451 cli.StringFlag {
428452 Name : "key" ,
429453 Usage : "The <file> of the private key to use instead of creating a new one (PEM file)." ,
430454 },
455+ cli.StringFlag {
456+ Name : "password-file" ,
457+ Usage : `The path to the <file> containing the password to
458+ encrypt the new private key or decrypt the user submitted private key.` ,
459+ },
431460 cli.BoolFlag {
432461 Name : "no-password" ,
433462 Usage : `Do not ask for a password to encrypt the private key.
434463Sensitive key material will be written to disk unencrypted. This is not
435464recommended. Requires **--insecure** flag.` ,
436- },
437- cli.StringFlag {
438- Name : "not-before" ,
439- Usage : `The <time|duration> set in the NotBefore property of the certificate. If a
440- <time> is used it is expected to be in RFC 3339 format. If a <duration> is
441- used, it is a sequence of decimal numbers, each with optional fraction and a
442- unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns",
443- "us" (or "µs"), "ms", "s", "m", "h".` ,
444- },
445- cli.StringFlag {
446- Name : "not-after" ,
447- Usage : `The <time|duration> set in the NotAfter property of the certificate. If a
448- <time> is used it is expected to be in RFC 3339 format. If a <duration> is
449- used, it is a sequence of decimal numbers, each with optional fraction and a
450- unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns",
451- "us" (or "µs"), "ms", "s", "m", "h".` ,
452- },
453- cli.StringSliceFlag {
454- Name : "san" ,
455- Usage : `Add DNS or IP Address Subjective Alternative Names (SANs). Use the '--san'
456- flag multiple times to configure multiple SANs.` ,
457465 },
458466 cli.BoolFlag {
459467 Name : "bundle" ,
460468 Usage : `Bundle the new leaf certificate with the signing certificate. This flag requires
461469the **--ca** flag.` ,
462470 },
463- flags .KTY ,
464- flags .Size ,
465- flags .Curve ,
466- flags .Force ,
467- flags .Subtle ,
468- cli.BoolFlag {
469- Name : "insecure" ,
470- Hidden : true ,
471- },
472- cli.StringFlag {
473- Name : "ca-kms" ,
474- Usage : "The <uri> to configure the KMS used for signing the certificate" ,
475- },
476471 cli.BoolFlag {
477472 Name : "skip-csr-signature" ,
478- Usage : "Skip creating and signing a CSR" ,
473+ Usage : "Skip creating and signing a CSR. " ,
479474 },
475+ flags .Force ,
476+ flags .Subtle ,
477+ flags .InsecureHidden ,
480478 },
481479 }
482480}
0 commit comments