Documentation
¶
Index ¶
- Constants
- func CheckPasswordHash(password, hash string) bool
- func Decryptb(key, text []byte) ([]byte, error)
- func Decrypts(key, text string) (string, error)
- func Encryptb(key, text []byte) ([]byte, error)
- func Encrypts(key, text string) (string, error)
- func FixKey(key []byte) []byte
- func GenerateCodeChallenge(method, codeVerifier string) (string, error)
- func HashPassword(password string) (string, error)
- func LoadPrivateKey(path string) (*rsa.PrivateKey, error)
- func RandomPassword(length int) (string, error)
- func SHA256(text string) string
- func SHA256b(bytes []byte) []byte
- type Keypair
- type TOTP
Constants ¶
View Source
const ( CodeChallengeMethodPlain = "plain" CodeChallengeMethodS256 = "S256" )
View Source
const (
DefaultCypherCost = 6 // recommended value for non admin users
)
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
CheckPasswordHash compares a password with a hash and returns true if they match
func GenerateCodeChallenge ¶
func HashPassword ¶
HashPassword hashes a password with the default cypher cost
func LoadPrivateKey ¶
func LoadPrivateKey(path string) (*rsa.PrivateKey, error)
func RandomPassword ¶
RandomPassword generates a random password of the specified length
Types ¶
type Keypair ¶
type Keypair struct { PrivateKey *rsa.PrivateKey PublicKey *rsa.PublicKey Kid string }
Keypair is an RSA Keypair & JWT KeyID used for OIDC Token signing
func NewKeypair ¶
func NewKeypair(key *rsa.PrivateKey) (*Keypair, error)
NewKeypair makes a Keypair off the provided rsa.PrivateKey or returns the package default if nil was passed
type TOTP ¶
type TOTP struct {
// contains filtered or unexported fields
}
/ The specifications for this are found in RFC 6238 / http://tools.ietf.org/html/rfc6238
func NewTOTPDefault ¶
Click to show internal directories.
Click to hide internal directories.