Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrExpiredToken = fmt.Errorf("%w: expired", ErrInvalidToken)
Error of a token older than the time to live it was checked against, also matching ErrInvalidToken
var ErrInvalidKey = errors.New("fernet key must be 32 bytes of padded url-safe base64")
Error of a key that is not 32 bytes in padded url-safe base64
var ErrInvalidToken = errors.New("invalid fernet token")
Error of every token that is malformed, forged, signed with another key or badly padded
Functions ¶
Types ¶
type Fernet ¶
type Fernet struct {
// contains filtered or unexported fields
}
Token encrypter and decrypter over one key, safe for concurrent use
func (*Fernet) Decrypt ¶
Plaintext of a token whatever its age, ErrInvalidToken for every token that does not verify and decrypt
func (*Fernet) DecryptTTL ¶
Plaintext of a token stamped no longer than ttl ago and not more than a minute ahead of the clock, ErrExpiredToken past the ttl; a ttl that is not positive checks no age