aboutsummaryrefslogtreecommitdiff
path: root/cmd/sigsum-debug/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/sigsum-debug/main.go')
-rw-r--r--cmd/sigsum-debug/main.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/cmd/sigsum-debug/main.go b/cmd/sigsum-debug/main.go
index 1d9e769..8b49e0b 100644
--- a/cmd/sigsum-debug/main.go
+++ b/cmd/sigsum-debug/main.go
@@ -31,9 +31,27 @@ Usage:
sigsum-debug hashkey
Reads a public key from stdin and output its key hash.
+
+ sigsum-debug hashleaf -k PRIVATE_KEY [-s SHARD_HINT]
+ Reads data from STDIN and outputs a leaf hash.
+ -k, --private-key Private key to sign with
+ -s, --shard-hint Shard hint to use (Default: 0)
+
+ sigsum-debug sign -k PRIVATE_KEY [-s SHARD_HINT]
+ Reads data from STDIN and outputs a signature.
+ -k, --private-key Private key to sign with
+ -s, --shard-hint Shard hint to use (Default: 0)
+
+ sigsum-debug cosign -w WIT_PRIV -l LOG_PUB
+ Reads an ASCII signed tree head from STDIN and outputs a cosignature.
+ -w, --witness-priv Witness private key to sign with
+ -l, --log-pub Log public key to verify signed tree head
`
var (
+ optPriv, optPub string
+ optShardHint uint64
+
someVersion = "unknown"
)
@@ -50,6 +68,12 @@ func main() {
err = CmdPubKey()
case "hashkey":
err = CmdHashKey()
+ case "hashleaf":
+ err = CmdHashLeaf(optPriv, optShardHint)
+ case "sign":
+ err = CmdSign(optPriv, optShardHint)
+ case "cosign":
+ err = fmt.Errorf("TODO")
default:
err = fmt.Errorf("invalid command %q, try %q", cmd.Name(), "sigsum help")
}
@@ -78,6 +102,15 @@ func parseCommand() *flag.FlagSet {
func registerOptions(fs *flag.FlagSet) {
switch cmd := fs.Name(); cmd {
default:
+ case "hashleaf":
+ registerStringOption(fs, &optPriv, "k", "key", "")
+ registerUint64Option(fs, &optShardHint, "s", "shard-hint", 0)
+ case "sign":
+ registerStringOption(fs, &optPriv, "k", "key", "")
+ registerUint64Option(fs, &optShardHint, "s", "shard-hint", 0)
+ case "cosign":
+ registerStringOption(fs, &optPriv, "w", "--witness-priv", "")
+ registerStringOption(fs, &optPub, "l", "--log-pub", "")
}
}