Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidKey = errors.New("Fernet key must be 32 url-safe base64-encoded bytes.")
ValueError Fernet raises for a key that is not 32 url safe base64 bytes
var ErrInvalidToken = errors.New("InvalidToken")
InvalidToken cryptography raises for a malformed, forged or undecryptable token
Functions ¶
func GenerateKey ¶
func GenerateKey() []byte
Url safe base64 of 32 random bytes, padded as cryptography emits it
Types ¶
type Fernet ¶
type Fernet struct {
// contains filtered or unexported fields
}
func (*Fernet) Decrypt ¶
Plaintext of a token without a ttl check, ErrInvalidToken for every failure cryptography folds into it