diff options
author | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2021-09-13 19:53:17 +0200 |
---|---|---|
committer | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2021-09-13 19:53:17 +0200 |
commit | 26b786d9857db21fdf110eaf9cb6d1d6e4e68ef9 (patch) | |
tree | 92606f47a91ebcc9e3cb4258af7a9472fc6f2e07 /cmd | |
parent | f34351da0731a11316e2266d2aadd62554a5b867 (diff) |
updated (co)signed tree head structuresv0.2.0
- Added key_hash in tree head, see motivation in api.md
- Added separate types for (co)signed tree heads
- Refactored tree head HTTP APIs to be current, see api.md
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/tmp/cosign/main.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/cmd/tmp/cosign/main.go b/cmd/tmp/cosign/main.go index 629e7ac..42162e4 100644 --- a/cmd/tmp/cosign/main.go +++ b/cmd/tmp/cosign/main.go @@ -13,11 +13,17 @@ import ( ) var ( - url = flag.String("url", "http://localhost:6965/sigsum/v0", "base url") - sk = flag.String("sk", "e1d7c494dacb0ddf809a17e4528b01f584af22e3766fa740ec52a1711c59500d711090dd2286040b50961b0fe09f58aa665ccee5cb7ee042d819f18f6ab5046b", "hex key") + url = flag.String("url", "http://localhost:6965/sigsum/v0", "base url") + sk = flag.String("sk", "e1d7c494dacb0ddf809a17e4528b01f584af22e3766fa740ec52a1711c59500d711090dd2286040b50961b0fe09f58aa665ccee5cb7ee042d819f18f6ab5046b", "witness secret key (hex)") + log_vk = flag.String("log_vk", "cc0e7294a9d002c33aaa828efba6622ab1ce8ebdb8a795902555c2813133cfe8", "log public key (hex)") ) func main() { + log_vk, err := hex.DecodeString(*log_vk) + if err != nil { + log.Fatalf("DecodeString: %v", err) + } + priv, err := hex.DecodeString(*sk) if err != nil { log.Fatalf("DecodeString: %v", err) @@ -34,7 +40,8 @@ func main() { if err := sth.UnmarshalASCII(rsp.Body); err != nil { log.Fatalf("UnmarshalASCII: %v", err) } - fmt.Printf("%+v\n", sth) + sth.TreeHead.KeyHash = types.Hash(log_vk) + fmt.Printf("%+v\n\n", sth) msg := sth.TreeHead.Marshal() sig := ed25519.Sign(sk, msg) |