password

package
v0.0.0-...-2dc66f2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateHashData

func GenerateHashData(ctx context.Context, secretKey, data string) string

func GenerateSignature

func GenerateSignature(ctx context.Context, msg, privateK string) (string, error)

func GetHashPassword

func GetHashPassword(password string) (string, error)

SetPassword sets cryptographically secure string to `model.Password`.

func ParsePrivateKey

func ParsePrivateKey(privateK string) (*rsa.PrivateKey, error)

func ParsePublicKey

func ParsePublicKey(publicK string) (*rsa.PublicKey, error)

func ValidateHashData

func ValidateHashData(ctx context.Context, data, secretKey, token string) error

func ValidatePassword

func ValidatePassword(passwordHash, password string) error

ValidatePassword validates a plain password against the model's password.

func VerifySignature

func VerifySignature(ctx context.Context, sig, msg, publicK string) error

Types

type RSAKeyPair

type RSAKeyPair struct {
	PublicKey  string
	PrivateKey string
}

func GenerateRSAKeyPair

func GenerateRSAKeyPair() (*RSAKeyPair, error)

Jump to

Keyboard shortcuts

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