package roottoken
import "github.com/hashicorp/vault/sdk/helper/roottoken"
Index ¶
- func DecodeToken(encoded, otp string, otpLength int) (string, error)
- func EncodeToken(token, otp string) (string, error)
- func GenerateOTP(otpLength int) (string, error)
Functions ¶
func DecodeToken ¶
DecodeToken will decode the root token returned by the Vault API The algorithm was initially used in the generate root command
func EncodeToken ¶
EncodeToken gets a token and an OTP and encodes the token. The OTP must have the same length as the token.
func GenerateOTP ¶
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.
Source Files ¶
- Version
- v0.18.0 (latest)
- Published
- Jun 5, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 1 month ago –
Tools for package owners.