Documentation ¶
Index ¶
- func CheckPasswordHash(password string, hash []byte) error
- func Decrypt(key, ciphertext []byte) (plaintext []byte, err error)
- func DecryptToken(key, t []byte) (string, error)
- func Encrypt(key, text []byte) (ciphertext []byte, err error)
- func EncryptToken(key []byte, t string) ([]byte, error)
- func GenerateRandomBytes(n int) ([]byte, error)
- func HashPassword(password string) ([]byte, error)
- func ReadEncryptionKey(v, f string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
CheckPasswordHash accepts a bcrypt salted hash and plaintext password. It verifies the password against the salted hash
func Decrypt ¶
Decrypt - Decrypt a token based on an encryption key The approach used here is based on the following direction on how to AES encrypt/decrypt our secret information, in this case tokens (normal, refresh and OAuth tokens). Source: https://github.com/giorgisio/examples/blob/master/aes-encrypt/main.go
func Encrypt ¶
Encrypt - Encrypt a token based on an encryption key The approach used here is based on the following direction on how to AES encrypt/decrypt our secret information, in this case tokens (normal, refresh and OAuth tokens). Source: https://github.com/giorgisio/examples/blob/master/aes-encrypt/main.go
func EncryptToken ¶
EncryptToken - Encrypt a token being
func GenerateRandomBytes ¶
See: https://github.com/gorilla/csrf/blob/a8abe8abf66db8f4a9750d76ba95b4021a354757/helpers.go generateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly.
func HashPassword ¶
HashPassword accepts a plaintext password string and generates a salted hash
func ReadEncryptionKey ¶
ReadEncryptionKey - Read the encryption key from the shared volume
Types ¶
This section is empty.