| 1 |
package otp |
| 2 |
|
| 3 |
import ( |
| 4 |
"github.com/urfave/cli" |
| 5 |
) |
| 6 |
|
| 7 |
|
| 8 |
func Command() cli.Command { |
| 9 |
return cli.Command{ |
| 10 |
Name: "otp", |
| 11 |
Usage: "generate and verify one-time passwords", |
| 12 |
UsageText: "step crypto otp <subcommand> [arguments] [global-flags] [subcommand-flags]", |
| 13 |
Description: `**step crypto otp** command group implements TOTP and HOTP one-time passwords |
| 14 |
(mention RFCs) |
| 15 |
|
| 16 |
## EXAMPLES |
| 17 |
|
| 18 |
Generate a new TOTP token and it's QR Code to scan: |
| 19 |
''' |
| 20 |
$ step crypto otp generate --issuer smallstep.com --account [email protected] -qr smallstep.png \> smallstep.totp |
| 21 |
|
| 22 |
$ cat smallstep.totp |
| 23 |
55RU6WTUISKKGEYVNSSI7H6FTJWJ4IPP |
| 24 |
''' |
| 25 |
|
| 26 |
Scan the QR Code using Google Authenticator, Authy or a similar software and |
| 27 |
use it to verify the TOTP token: |
| 28 |
''' |
| 29 |
$ step crypto otp verify --secret smallstep.totp |
| 30 |
Enter Passcode: 614318 |
| 31 |
ok |
| 32 |
'''`, |
| 33 |
Subcommands: cli.Commands{ |
| 34 |
generateCommand(), |
| 35 |
verifyCommand(), |
| 36 |
}, |
| 37 |
} |
| 38 |
} |