Categorygithub.com/fernet/fernet-go
modulepackage
0.0.0-20240119011108-303da6aec611
Repository: https://github.com/fernet/fernet-go.git
Documentation: pkg.go.dev

# README

Fernet takes a user-provided message (an arbitrary sequence of bytes), a key (256 bits), and the current time, and produces a token, which contains the message in a form that can't be read or altered without the key.

This package is compatible with the other implementations at https://github.com/fernet. They can exchange tokens freely among each other.

Documentation: http://godoc.org/github.com/fernet/fernet-go

INSTALL

$ go get github.com/fernet/fernet-go

For more information and background, see the Fernet spec at https://github.com/fernet/spec.

Fernet is distributed under the terms of the MIT license. See the License file for details.

# Packages

No description provided by the author

# Functions

DecodeKey decodes a key from s and returns it.
DecodeKeys decodes each element of a using DecodeKey and returns the resulting keys.
EncryptAndSign encrypts and signs msg with key k and returns the resulting fernet token.
EncryptAndSignAtTime encrypts and signs msg with key k at timestamp signedAt and returns the resulting fernet token.
MustDecodeKeys is like DecodeKeys, but panics if an error occurs.
VerifyAndDecrypt verifies that tok is a valid fernet token that was signed with a key in k at most ttl time ago only if ttl is greater than zero.

# Type aliases

Key represents a key.