https://github.com/pnelson/miller
Package miller implements tamper resistant message signing and verification.
https://github.com/pnelson/miller
Last synced: 6 months ago
JSON representation
Package miller implements tamper resistant message signing and verification.
- Host: GitHub
- URL: https://github.com/pnelson/miller
- Owner: pnelson
- License: other
- Created: 2016-09-20T02:18:57.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2021-11-20T05:47:45.000Z (over 4 years ago)
- Last Synced: 2025-10-13T05:13:03.320Z (9 months ago)
- Language: Go
- Homepage: https://pkg.go.dev/github.com/pnelson/miller
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.
```go
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"
```