sec

package
v0.0.0-...-1c93661 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2016 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPasswordTooShort = errors.New("passwords must be at least 8 bytes long")
View Source
var ErrUsernameTooShort = errors.New("usernames must be at least 1 byte long")

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	Name           string
	Salt           string
	HashedPassword string
}

Credentials holds a user's hashed password and salt.

func NewCredentials

func NewCredentials(username string, password string) (Credentials, error)

NewCredentials creates a new user with a salt and hashed password

func (Credentials) Authenticate

func (c Credentials) Authenticate(password string) (bool, error)

Authenticate checks if the password is correct.

Jump to

Keyboard shortcuts

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