Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.
/ iron-go Public archive

Implementation of Iron HMAC cookies in Go

License

Notifications You must be signed in to change notification settings

microsoft/iron-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iron-go Build Status godoc reference

iron-go is an implementation of Iron cookies for Go. It's fully inter-operable with the Node version. Currently it supports sealing and unsealing using a single secret key, but it should be fairly trivial to implement rotation in the future. [Citation Needed]

v := iron.New(Options{Secret: password})

// encrypt your cookie:

cookie, err := v.Seal(yourData)

// Later....

payload, err := v.Unseal(cookie)

// Use your data!

CLI

iron-go includes a simple CLI to seal and unseal cookies. Install via:

go install github.com/WatchBeam/iron-go/cmd/iron

Usage example:

➜  iron-go git:(master) iron --help
usage: iron --secret=SECRET [<flags>] <command> [<args> ...]

Flags:
      --help           Show context-sensitive help (also try --help-long and --help-man).
  -s, --secret=SECRET  Cookie encryption password
  -v, --value=VALUE    Cookie contents. If not provided, reads from stdin.

Commands:
  help [<command>...]
    Show help.

  seal
    Encrypts the cookie

  unseal
    Decrypts the cookie


➜  iron-go git:(master) pbpaste | iron unseal --secret=somethingatleast32characterslong
{"hello":"world!"}

About

Implementation of Iron HMAC cookies in Go

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages