Documentation
¶
Overview ¶
Package gauth implements the time-based OTP generation scheme used by Google Authenticator.
Index ¶
- func Codes(u *otpauth.URL) (prev, curr, next string, _ error)
- func CodesAtTimeStep(u *otpauth.URL, timeStep uint64) (prev, curr, next string, _ error)
- func IndexNow() (uint64, int)
- func LoadConfigFile(path string, getPass func() ([]byte, error)) ([]byte, error)
- func ParseConfig(data []byte) ([]*otpauth.URL, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CodesAtTimeStep ¶
CodesAtTimeStep returns the previous, current, and next codes from u at the given time step value.
func IndexNow ¶
IndexNow returns the current 30-second time step, and the number of seconds remaining until it ends.
func LoadConfigFile ¶
LoadConfigFile reads and decrypts, if necessary, the CSV config at path. The getPass function is called to obtain a password if needed.
func ParseConfig ¶
ParseConfig parses the contents of data as a gauth configuration file. Each line of the file specifies a single configuration.
The basic configuration format is:
name:secret
where "name" is the site name and "secret" is the base32-encoded secret. This represents a default Google authenticator code with 6 digits and a 30-second refresh.
Otherwise, a line must be a URL in the format:
otpauth://TYPE/LABEL?PARAMETERS
Types ¶
This section is empty.