Documentation
¶
Index ¶
- func Base64String(size int) (string, error)
- func HashPassword(password string) (string, error)
- func HashToken(token string) string
- func NewRandomKey(ctx context.Context, encryptor Encryptor, name string) (string, []byte, error)
- func SHA256ForMap(m map[string]string) (string, error)
- func VerifyPassword(hash, password string) bool
- func VerifySignature(key []byte, data []byte, signature string) error
- type AESGCMEncryptor
- type Encryptor
- type NoOpEncryptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64String ¶
func HashPassword ¶ added in v0.0.18
HashPassword hashes a plaintext password using bcrypt
func NewRandomKey ¶
func VerifyPassword ¶ added in v0.0.18
VerifyPassword verifies a plaintext password against a bcrypt hash
Types ¶
type AESGCMEncryptor ¶
type AESGCMEncryptor struct {
// contains filtered or unexported fields
}
type Encryptor ¶
type Encryptor interface {
Encrypt(context.Context, []byte, []byte) ([]byte, error)
Decrypt(context.Context, []byte, []byte) ([]byte, error)
}
func NewAESGCMEncryptor ¶
func NewNoOpEncryptor ¶
func NewNoOpEncryptor() Encryptor
Click to show internal directories.
Click to hide internal directories.