Documentation
¶
Index ¶
- Variables
- func CreateTokenJWT(username string) (string, error)
- func Decrypt(ciphertext []byte, key []byte) ([]byte, error)
- func Encrypt(plaintext []byte, key []byte) ([]byte, error)
- func Generate(passphrase string, options *Argon2idOptions) (key, salt []byte, err error)
- func NewHash(passphrase string, options *Argon2idOptions) (hash string, err error)
- func VerifyTokenJWT(tokenStr string) (*jwt.Token, error)
- type Argon2idOptions
- type Password
Constants ¶
This section is empty.
Variables ¶
View Source
var MyArgon2idOptions = NewArgon2idOptions(10, 50, 12)
Functions ¶
func CreateTokenJWT ¶
func Generate ¶
func Generate(passphrase string, options *Argon2idOptions) (key, salt []byte, err error)
Generate secret key and salt (argon2id KDF) from passphrase and options.
Types ¶
type Argon2idOptions ¶
func Compare ¶
func Compare(passphrase string, hash string) (bool, *Argon2idOptions, error)
Compare passphrase and decoded hash
func Decode ¶
func Decode(hash string) (key, salt []byte, options *Argon2idOptions, err error)
Decode argon2id hash and returns secret key, salt and options
func NewArgon2idOptions ¶
func NewArgon2idOptions(iterations, mb uint32, parallel uint8) Argon2idOptions
Click to show internal directories.
Click to hide internal directories.