basicauth

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0, BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DerivePasswordKey

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

DerivePasswordKey calculates the key based on password and salt.

func SaltGenerator

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

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

func NewBasicAuth

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

func (*BasicAuth) VerifyUsernameAndPassword

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