aboutsummaryrefslogtreecommitdiff
path: root/server/testdata/entry/main.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-03 20:10:54 +0100
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-03 20:10:54 +0100
commit80c77449756c102381278d7ebeeb7b448cd6a16a (patch)
tree4ba51a40d9daa58c5e7030cf991f075be78b1931 /server/testdata/entry/main.go
parent43ead4759139841d3000e2e283d411c5262d8736 (diff)
removed obsolete test scripts
Diffstat (limited to 'server/testdata/entry/main.go')
-rw-r--r--server/testdata/entry/main.go44
1 files changed, 0 insertions, 44 deletions
diff --git a/server/testdata/entry/main.go b/server/testdata/entry/main.go
deleted file mode 100644
index 7ab6d4d..0000000
--- a/server/testdata/entry/main.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package main
-
-import (
- "flag"
- "os"
-
- "crypto/sha256"
- "io/ioutil"
-
- "github.com/golang/glog"
- "github.com/system-transparency/stfe"
-)
-
-var (
- name = flag.String("name", "foobar-1.2.3", "a package identifier")
- dir = flag.String("dir", "stitem", "directory path where output is stored")
-)
-
-func main() {
- flag.Parse()
-
- // Use H(name) as a dummy checksum
- hasher := sha256.New()
- hasher.Write([]byte(*name))
- checksum := hasher.Sum(nil)
-
- // Create and serialize an StItem of type checksum_v1
- serialized, err := stfe.NewChecksumV1([]byte(*name), checksum).Marshal()
- if err != nil {
- glog.Fatalf("%v", err)
- }
-
- // Store the serialized item in *dir/name
- if err := os.MkdirAll(*dir, 0755); err != nil {
- glog.Fatalf("creating directory %s failed: %v", *dir, err)
- }
- path := *dir + "/" + *name
- if err := ioutil.WriteFile(path, serialized, 0644); err != nil {
- glog.Fatalf("writing to %s failed: %v", path, err)
- }
-
- glog.Infof("Created serialized checksum_v1 StItem: %s", path)
- glog.Flush()
-}