Documentation
¶
Index ¶
- func DecodeBase64(s string) (string, error)
- func GenerateECDSAKey() (*ecdsa.PrivateKey, error)
- func GenerateSecretPEMKey(filename string) error
- func GetEnv(key string) string
- func GetPEMKeyPair(key *ecdsa.PrivateKey) (privKeyPEM []byte, pubKeyPEM []byte, err error)
- func HashAndSalt(password string) (string, error)
- func IsRestrictedUser(username string) bool
- func IsValidPassword(s string) bool
- func IsValidUserName(username string) bool
- func ParseToken(authorization string) (string, error)
- func ReadSecretKey(filename string) ([]byte, error)
- func ToMaxAge(expire time.Time) int
- func ValidateUser(u *models.User) error
- func VerifyHash(password, hash string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBase64 ¶ added in v1.1.1
DecodeBase64 decodes the base64 string
func GenerateECDSAKey ¶
func GenerateECDSAKey() (*ecdsa.PrivateKey, error)
GenerateECDSAKey generates a new ECDSA key pair
func GenerateSecretPEMKey ¶
GenerateSecretPEMKey generates a new PEM key pair
func GetPEMKeyPair ¶
func GetPEMKeyPair(key *ecdsa.PrivateKey) (privKeyPEM []byte, pubKeyPEM []byte, err error)
GetPEMKeyPair reads the private key and returns the PrivateKey and publicKey
func HashAndSalt ¶
HashAndSalt generates a hashed password
func IsRestrictedUser ¶
IsRestrictedUser checks if the user is restricted
func IsValidPassword ¶
IsValidPassword checks if the password (Strength) is valid
func IsValidUserName ¶
IsValidUserName checks if the username is valid
func ParseToken ¶
ParseToken parses the token from authorization header
func ReadSecretKey ¶
ReadSecretKey reads the secret key from the file
func VerifyHash ¶
VerifyHash verifies the hashed password
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.