Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidAlgo = errors.New("invalid algorithm was used to verify this password")
View Source
var ErrMalformedHash = errors.New("encoded password hash is malformed and can't be decoded")
View Source
var ErrPasswordInvalid = errors.New("password does not match hash given")
Functions ¶
This section is empty.
Types ¶
type Argon2IDPasswordHasher ¶
type Argon2IDPasswordHasher struct { AlgoID []byte SaltRNG io.Reader Options Argon2Options // needs to be set, defaults are not valid options }
func (*Argon2IDPasswordHasher) HashPassword ¶
func (h *Argon2IDPasswordHasher) HashPassword(password []byte) (hash PasswordHash, err error)
func (*Argon2IDPasswordHasher) ValidatePassword ¶
func (h *Argon2IDPasswordHasher) ValidatePassword(password []byte, hash PasswordHash) (err error)
type Argon2Options ¶
type PasswordHash ¶
func (*PasswordHash) Decode ¶
func (h *PasswordHash) Decode(buf []byte) (err error)
Decode decodes encoded PasswordHash into structure, which has this method called on. Removes any previous data.
type PasswordHasher ¶
type PasswordHasher interface {
HashPassword(password []byte) (hash PasswordHash, err error)
}
type PasswordVerifier ¶
type PasswordVerifier interface {
ValidatePassword(password []byte, hash PasswordHash) (err error)
}
Click to show internal directories.
Click to hide internal directories.