basicauth

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DerivePasswordKey added in v1.0.5

func DerivePasswordKey(password []byte, salt []byte) ([]byte, error)

DerivePasswordKey calculates the key based on password and salt.

func SaltGenerator added in v1.0.0

func SaltGenerator(length int) ([]byte, error)

SaltGenerator generates a crypto-secure random salt.

func VerifyPassword

func VerifyPassword(password []byte, salt []byte, storedPasswordKey []byte) (bool, error)

VerifyPassword verifies if the password is correct.

Types

type BasicAuth added in v1.0.0

type BasicAuth struct {
	// contains filtered or unexported fields
}

func NewBasicAuth added in v1.0.0

func NewBasicAuth(username string, passwordHashHex string, passwordSaltHex string) (*BasicAuth, error)

func (*BasicAuth) VerifyUsernameAndPassword added in v1.0.0

func (b *BasicAuth) VerifyUsernameAndPassword(username string, password string) bool

Jump to

Keyboard shortcuts

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