Module totp_rfc6238::oath_uri[][src]

Read or write URIs start with otpauth://totp/.

This module requires oathuri feature gate.

The functions and methods in this module will automatically try to overwrite the key-related memory areas that are no longer used with zeros before being released. But this operation is only a best effort. There is no guarantee that any memory area that may have touched the key byte is safely cleared. Because some other crates called in this process may not consider this aspect. It may also be our negligence in writing code. If you have suggestions for improvement, welcome to open a Pull Request.

Note

This URI format is refering to https://github.com/google/google-authenticator/wiki/Key-Uri-Format And only TOTP is implemented in this crate.

Since the Unix timestamp of the initial counter time T0 is not defined in the URI, this module will always set T0 to the default value of RFC 6238 Section 4.

Structs

KeyInfo

This struct stores the key bytes, the issuer and account name.

TotpUri

This struct provides reading and writing TOTP URIs.

Enums

OathUriError

Types of errors that may occur.

Functions

key_from_base32

Read key bytes from a base32-encoded String.

key_to_base32_lowercase

Write key bytes to a base32-encoded String in lowercase (Not a standard base32).

key_to_base32_uppercase

Write key bytes to a base32-encoded String in uppercase.