Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 558 Bytes

README.md

File metadata and controls

24 lines (20 loc) · 558 Bytes

miller

Package miller implements tamper resistant message signing and verification.

Usage

The default tag is used for this example. Tags can be used to namespace your tokens. For example, if you issue account confirmation and recovery tokens, different tags can be used so that confirmation tokens cannot be used for account recovery.

t := miller.New(miller.DefaultTag, []byte("secret"))
token, err := t.Sign("foo")
if err != nil {
  log.Fatal(err)
}
var s string
err = t.Verify(token, &s)
if err != nil {
  log.Fatal(err)
}
// s == "foo"