bcrypto

package
v0.0.0-...-32d14c1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPasswordsDoNotMatch = errors.New("passwords do not match")

Functions

This section is empty.

Types

type BCrypt

type BCrypt struct {
	Length        int
	MixedCase     bool
	AlphaNum      bool
	SpecialChar   bool
	CheckPrevious bool
}

func NewSecurityFramework

func NewSecurityFramework(cfg config.Security) *BCrypt

func (*BCrypt) ConfirmationChecker

func (s *BCrypt) ConfirmationChecker(password, confirmPassword string) error

ConfirmationChecker compares two given literal password inputs and returns whether they are equivalent.

func (*BCrypt) Hash

func (s *BCrypt) Hash(password string) string

Hash takes as input a given password and hashes it so it is suitable for persistent repository

func (*BCrypt) IsValid

func (s *BCrypt) IsValid(password string) error

IsValid validates whether a given string complies with the policy as declared by PasswordPolicy

func (*BCrypt) VerifyPasswordMatches

func (s *BCrypt) VerifyPasswordMatches(hashedPW, givenPW string) error

VerifyPasswordMatches verifies that a given password is equivalent to its hashed form

Jump to

Keyboard shortcuts

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