Go implementation of the in-toto Python reference implementation.
To read the documentation along with some examples, run:
godoc -http :8080
and navigate to localhost:8080/pkg/github.com/in-toto/in-toto-golang/in_toto/
A very simple example, just to help you starting:
package main
import (
"time"
toto "github.com/in-toto/in-toto-golang/in_toto"
)
func main() {
t := time.Now()
t = t.Add(30 * 24 * time.Hour)
var keys = make(map[string]toto.Key)
var metablock = toto.Metablock{
Signed: toto.Layout{
Type: "layout",
Expires: t.Format("2006-01-02T15:04:05Z"),
Steps: []toto.Step{},
Inspect: []toto.Inspection{},
Keys: keys,
},
}
var key toto.Key
key.LoadKey("keys/alice", "rsassa-pss-sha256", []string{"sha256", "sha512"})
metablock.Sign(key)
metablock.Dump("root.layout")
}
This golang implementation was focused on verification on admission controllers and kubectl plugins. As such, it focused on providing a strong, auditable set of core functions rather than a broad and (possibly) unstable feature set. In other words, we believe that the current feature set is stable enough for production use.
If any of these features are necessary for your use case please let us know and we will try to provide them as soon as possible!