.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "URI::otpauth 3"
.TH URI::otpauth 3 2024-12-15 "perl v5.40.0" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
URI::otpauth \- URI scheme for secret keys for OTP secrets. Usually found in QR codes
.SH VERSION
.IX Header "VERSION"
Version 5.29
.SH SYNOPSIS
.IX Header "SYNOPSIS"
.Vb 1
\& use URI;
\&
\& # optauth URI from textual uri
\& my $uri = URI\->new( \*(Aqotpauth://totp/Example:alice@google.com?secret=NFZS25DINFZV643VOAZXELLTGNRXEM3UH4&issuer=Example\*(Aq );
\&
\& # same URI but created from arguments
\& my $uri = URI::otpauth\->new( type => \*(Aqtotp\*(Aq, issuer => \*(AqExample\*(Aq, account_name => \*(Aqalice@google.com\*(Aq, secret => \*(Aqis\-this_sup3r\-s3cr3t?\*(Aq );
.Ve
.SH DESCRIPTION
.IX Header "DESCRIPTION"
This URI scheme is defined in :
.SH SUBROUTINES/METHODS
.IX Header "SUBROUTINES/METHODS"
.ie n .SS """new"""
.el .SS \f(CWnew\fP
.IX Subsection "new"
Create a new URI::otpauth. The available arguments are listed below;
.IP \(bu 4
account_name \- this can be the account name (probably an email address) used when authenticating with this secret. It is an optional field.
.IP \(bu 4
algorithm \- this is the cryptographic hash function that should be used. Current values are SHA1 , SHA256 or SHA512 . It is an optional field and will default to SHA1.
.IP \(bu 4
counter \- this is only required when the type is HOTP.
.IP \(bu 4
digits \- this determines the length of the code presented to the user. It is an optional field and will default to 6 digits.
.IP \(bu 4
issuer \- this can be the application / system that this secret can be used to authenticate to. It is an optional field.
.IP \(bu 4
label \- this is the issuer and the account name joined with a ":" character. It is an optional field.
.IP \(bu 4
period \- this is the period that the TOTP code is valid for . It is an optional field and will default to 30 seconds.
.IP \(bu 4
secret \- this is the key that the TOTP /HOTP algorithm uses to derive the value. It is an arbitrary byte string and must remain private. This field is mandatory.
.IP \(bu 4
type \- this can be 'hotp ' or 'totp '. This field will default to 'totp'.
.ie n .SS """algorithm"""
.el .SS \f(CWalgorithm\fP
.IX Subsection "algorithm"
Get or set the algorithm of this otpauth URI.
.ie n .SS """account_name"""
.el .SS \f(CWaccount_name\fP
.IX Subsection "account_name"
Get or set the account_name of this otpauth URI.
.ie n .SS """counter"""
.el .SS \f(CWcounter\fP
.IX Subsection "counter"
Get or set the counter of this otpauth URI.
.ie n .SS """digits"""
.el .SS \f(CWdigits\fP
.IX Subsection "digits"
Get or set the digits of this otpauth URI.
.ie n .SS """issuer"""
.el .SS \f(CWissuer\fP
.IX Subsection "issuer"
Get or set the issuer of this otpauth URI.
.ie n .SS """label"""
.el .SS \f(CWlabel\fP
.IX Subsection "label"
Get or set the label of this otpauth URI.
.ie n .SS """period"""
.el .SS \f(CWperiod\fP
.IX Subsection "period"
Get or set the period of this otpauth URI.
.ie n .SS """secret"""
.el .SS \f(CWsecret\fP
.IX Subsection "secret"
Get or set the secret of this otpauth URI.
.ie n .SS """type"""
.el .SS \f(CWtype\fP
.IX Subsection "type"
Get or set the type of this otpauth URI.
.PP
.Vb 1
\& my $type = $uri\->type(\*(Aqhotp\*(Aq);
.Ve
.SH "CONFIGURATION AND ENVIRONMENT"
.IX Header "CONFIGURATION AND ENVIRONMENT"
URI::otpauth requires no configuration files or environment variables.
.SH DEPENDENCIES
.IX Header "DEPENDENCIES"
URI
.SH DIAGNOSTICS
.IX Header "DIAGNOSTICS"
.ie n .IP """secret is a mandatory parameter for URI::otpauth""" 4
.el .IP "\f(CWsecret is a mandatory parameter for URI::otpauth\fR" 4
.IX Item "secret is a mandatory parameter for URI::otpauth"
The secret parameter was not detected for the URI::otpauth\->\fBnew()\fR method.
.SH INCOMPATIBILITIES
.IX Header "INCOMPATIBILITIES"
None reported.
.SH "BUGS AND LIMITATIONS"
.IX Header "BUGS AND LIMITATIONS"
To report a bug, or view the current list of bugs, please visit
.SH AUTHOR
.IX Header "AUTHOR"
David Dick \f(CW\*(C`\*(C'\fR
.SH "LICENSE AND COPYRIGHT"
.IX Header "LICENSE AND COPYRIGHT"
Copyright (c) 2024, David Dick \f(CW\*(C`\*(C'\fR.
.PP
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself. See perlartistic.