roottoken

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2022 License: MPL-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeToken

func DecodeToken(encoded, otp string, otpLength int) (string, error)

DecodeToken will decode the root token returned by the Vault API The algorithm was initially used in the generate root command

func EncodeToken

func EncodeToken(token, otp string) (string, error)

EncodeToken gets a token and an OTP and encodes the token. The OTP must have the same length as the token.

func GenerateOTP

func GenerateOTP(otpLength int) (string, error)

GenerateOTP generates a random token and encodes it as a Base64 or as a Base62 encoded string. Returns 0 if the generation completed without any error, 2 otherwise, along with the error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL