diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-08-26 23:59:30 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-08-26 23:59:30 +0200 |
commit | 1a8a9385372a1098c828dff4aed969c4491c2d2d (patch) | |
tree | eacb5b59b56a6d08eb69aab189f8b985689e9242 /totp.1 | |
parent | eca55d402d6918e1028a973f84e949d71f5cdf59 (diff) |
Update the manual
Diffstat (limited to 'totp.1')
-rw-r--r-- | totp.1 | 76 |
1 files changed, 31 insertions, 45 deletions
@@ -1,4 +1,4 @@ -.Dd $Mdocdate: October 3 2023 $ +.Dd August 26 2024 .Dt TOTP 1 .Os .Sh NAME @@ -8,72 +8,58 @@ .Nm .Op Fl d Ar digits .Op Fl p Ar period -.Op Fl u +.Op Fl h .Op Ar secret ... .Sh DESCRIPTION .Nm -is a utility to generate TOTP codes on the command\-line. -You can provide TOTP secret codes either through the standard input or as -command\-line. -If you would like to use OTP URIs instead, those are also supported through the -.Fl u -option, which enables URI parsing of inputs. -.Pp -When working with OTP URIs, metadata regarding the digit length or the duration -period of TOTP codes is typically contained within the URI, and -.Nm -parses and interprets that information for you. -This is not the case when using raw TOTP secret codes. -When using TOTP secret codes, it is assumed that TOTP codes are 6 digits long -with a duration of 30 seconds. -If you need different defaults you can make use of the -.Fl d -and -.Fl p -flags. +is a utility for generating TOTP codes. +If no +.Ar secret +is provided as a command-line argument, +secret keys are read newline-separated from the standard input. .Pp The options are as follows: .Bl -tag width Ds .It Fl d , Fl Fl digits Ns = Ns Ar length -Set the digit length of TOTP codes to -.Ar length . -If this flag is not specified, the digit length defaults to 6 digits. +Specify the length in digits of the generated TOTP codes. +The default +.Ar length +value is 6. +.It Fl h , Fl Fl help +Display help information by opening this manual page. .It Fl p , Fl Fl period Ns = Ns Ar seconds -Set the duration period of TOTP codes to -.Ar seconds . -If this flag is not specified, the duration period defaults to 30 seconds. -.It Fl u , Fl Fl uri -Interpret input as OTP URIs instead of raw TOTP secret keys. +Specify the duration for which the generated TOTP codes are valid. +The default +.Ar seconds +value is 30. .El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES Get TOTP codes for two different secret keys using the standard input: .Pp -.Dl $ printf '7KFSJ562KJDK23KD\en7YNEG7J3XBIVYR54' | totp +.Dl $ printf \(aq7KFSJ562KJDK23KD\en7YNEG7J3XBIVYR54\(aq | totp .Pp The same as the above but using command\-line arguments: .Pp .Dl $ totp 7KFSJ562KJDK23KD 7YNEG7J3XBIVYR54 .Pp -Get a TOTP code for an OTP URI: -.Pp -.Dl $ totp -u 'otpauth://totp/GitHub:Mango0x45?secret=7YNEG7J3XBIVYR54' -.Pp -The same as above, but extract the URI from a QR\-code using -.Xr zbarimg 1 : -.Pp -.Dl $ zbarimg -q qr.png | sed 's/QR-Code://' | totp -u -.Pp Generate an 8 digit TOTP code that is valid for 60 seconds: .Pp .Dl $ totp -d8 -p60 7KFSJ562KJDK23KD -.Sh SEE ALSO -.Xr sed 1 , -.Xr zbarimg 1 , -.Xr HMAC 3ssl , -.Xr SHA1 3ssl .Pp -.Lk https://thomasvoss.com/prj/totp "Extended Description and -Documentation" +.\" TODO: Write a URI parsing CLI tool and show an example of handing +.\" optauth URIS +.\" Get a TOTP code from an optauth URI: +.\" .Pp +.\" .Bd -literal -offset indent +.\" $ totp -u 'otpauth://totp/GitHub:Mango0x45?secret=7YNEG7J3XBIVYR54' +.\" .Ed +.\" .Pp +.\" The same as above, but extract the URI from a QR\-code using +.\" .Xr zbarimg 1 : +.\" .Pp +.\" .Dl $ zbarimg -q qr.png | sed 's/QR-Code://' | totp -u +.\" .Pp .Sh AUTHORS .An Thomas Voss Aq Mt mail@thomasvoss.com |