Documentation ¶
Overview ¶
Package security provides functions for encryption of passwords and JWT token handling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncryptPassword ¶
EncryptPassword encrypts the given password with Bcrypt algorithm and returns the generated hash.
func GenerateJWT ¶
GenerateJWT generates new JWT with a username as a claim and authenticated claim set to false, because 2FA is needed to be fully authenticated. The JWT has an expiration time equal to the expirationDuration variable. The signing algorithm is HS256.
func HashAndPasswordMatch ¶
HashAndPasswordMatch takes a hash and a password and determines if the hash matches the entered password.
func ValidateToken ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.