Documentation
¶
Index ¶
- func GenerateHashData(ctx context.Context, secretKey, data string) string
- func GenerateSignature(ctx context.Context, msg, privateK string) (string, error)
- func GetHashPassword(password string) (string, error)
- func ParsePrivateKey(privateK string) (*rsa.PrivateKey, error)
- func ParsePublicKey(publicK string) (*rsa.PublicKey, error)
- func ValidateHashData(ctx context.Context, data, secretKey, token string) error
- func ValidatePassword(passwordHash, password string) error
- func VerifySignature(ctx context.Context, sig, msg, publicK string) error
- type RSAKeyPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSignature ¶
func GetHashPassword ¶
SetPassword sets cryptographically secure string to `model.Password`.
func ParsePrivateKey ¶
func ParsePrivateKey(privateK string) (*rsa.PrivateKey, error)
func ValidateHashData ¶
func ValidatePassword ¶
ValidatePassword validates a plain password against the model's password.
Types ¶
type RSAKeyPair ¶
func GenerateRSAKeyPair ¶
func GenerateRSAKeyPair() (*RSAKeyPair, error)
Click to show internal directories.
Click to hide internal directories.