@@ -30,7 +30,7 @@ func tokenCommand() cli.Command {
3030[**--output-file**=<file>] [**--kms**=uri] [**--key**=<file>] [**--san**=<SAN>] [**--offline**]
3131[**--revoke**] [**--x5c-cert**=<file>] [**--x5c-key**=<file>] [**--x5c-insecure**]
3232[**--sshpop-cert**=<file>] [**--sshpop-key**=<file>]
33- [**--cnf-file **=<file >] [**--cnf-kid **=<fingerprint >]
33+ [**--cnf**=<fingerprint >] [**--cnf-file **=<file >]
3434[**--ssh**] [**--host**] [**--principal**=<name>] [**--k8ssa-token-path**=<file>]
3535[**--ca-url**=<uri>] [**--root**=<file>] [**--context**=<name>]` ,
3636 Description : `**step ca token** command generates a one-time token granting access to the
@@ -86,6 +86,13 @@ Get a new token that becomes valid in 30 minutes and expires 5 minutes after tha
8686$ step ca token --not-before 30m --not-after 35m internal.example.com
8787'''
8888
89+ Get a new token with a confirmation claim to enforce a given CSR fingerprint:
90+ '''
91+ $ step certificate fingerprint --format base64-url-raw internal.csr
92+ PJLNhtQoBE1yGN_ZKzr4Y2U5pyqIGiyyszkoz2raDOw
93+ $ step ca token --cnf PJLNhtQoBE1yGN_ZKzr4Y2U5pyqIGiyyszkoz2raDOw internal.smallstep.com
94+ '''
95+
8996Get a new token with a confirmation claim to enforce the use of a given CSR:
9097'''
9198step ca token --cnf-file internal.csr internal.smallstep.com
@@ -200,8 +207,8 @@ multiple principals.`,
200207 flags .SSHPOPKey ,
201208 flags .NebulaCert ,
202209 flags .NebulaKey ,
210+ flags .Confirmation ,
203211 flags .ConfirmationFile ,
204- flags .ConfirmationKid ,
205212 cli.StringFlag {
206213 Name : "key" ,
207214 Usage : `The private key <file> used to sign the JWT. This is usually downloaded from
@@ -258,7 +265,7 @@ func tokenAction(ctx *cli.Context) error {
258265 principals := ctx .StringSlice ("principal" )
259266 // confirmation claims
260267 cnfFile := ctx .String ("cnf-file" )
261- cnfKid := ctx .String ("cnf-kid " )
268+ cnf := ctx .String ("cnf" )
262269
263270 switch {
264271 case isSSH && len (sans ) > 0 :
@@ -271,8 +278,8 @@ func tokenAction(ctx *cli.Context) error {
271278 return errs .RequiredWithFlag (ctx , "host" , "ssh" )
272279 case ! isSSH && len (principals ) > 0 :
273280 return errs .RequiredWithFlag (ctx , "principal" , "ssh" )
274- case cnfFile != "" && cnfKid != "" :
275- return errs .IncompatibleFlagWithFlag (ctx , "cnf-file" , "cnf-kid " )
281+ case cnfFile != "" && cnf != "" :
282+ return errs .IncompatibleFlagWithFlag (ctx , "cnf-file" , "cnf" )
276283 }
277284
278285 // Default token type is always a 'Sign' token.
@@ -337,8 +344,8 @@ func tokenAction(ctx *cli.Context) error {
337344 }
338345 tokenOpts = append (tokenOpts , cautils .WithCertificateRequest (csr ))
339346 }
340- } else if cnfKid != "" {
341- tokenOpts = append (tokenOpts , cautils .WithConfirmationKid ( cnfKid ))
347+ } else if cnf != "" {
348+ tokenOpts = append (tokenOpts , cautils .WithConfirmationFingerprint ( cnf ))
342349 }
343350
344351 // --san and --type revoke are incompatible. Revocation tokens do not support SANs.
0 commit comments