Skip to content

msakrejda/fernet-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fernet allows you to easily generate and verify HMAC-based
authentication tokens for issuing API requests between remote
servers. It also encrypts data, so it can be used to transmit
secure messages over the wire.

This package is compatible with the Ruby implementation at
https://github.com/hgmnz/fernet. They can exchange tokens
freely in both directions.

See http://godoc.org/github.com/kr/fernet for documentation.


INSTALL

	$ go get github.com/kr/fernet


EXAMPLE

	var key = fernet.MustDecodeKey(os.Getenv("MYSECRET"))

	func main() {
		token := key.EncryptAndSign([]byte("foo"))
		// ...

		if data := key.VerifyAndDecrypt(token, time.Minute); data != nil {
			// ...
		}
	}

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

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

About

Fernet generates and verifies HMAC-based authentication tokens.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%