From cc9bb6a069d62ed37b7f4866d6dfe37049dc1cf1 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Sat, 23 Apr 2022 18:44:09 +0200 Subject: remove sigsum-debug (pending merge in sigsum-go) --- cmd/sigsum-debug/cosign/cosign.go | 41 --------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 cmd/sigsum-debug/cosign/cosign.go (limited to 'cmd/sigsum-debug/cosign') diff --git a/cmd/sigsum-debug/cosign/cosign.go b/cmd/sigsum-debug/cosign/cosign.go deleted file mode 100644 index 8597cc6..0000000 --- a/cmd/sigsum-debug/cosign/cosign.go +++ /dev/null @@ -1,41 +0,0 @@ -package cosign - -import ( - "bytes" - "fmt" - - "git.sigsum.org/sigsum-go/pkg/hex" - "git.sigsum.org/sigsum-go/pkg/types" - "git.sigsum.org/sigsum-tools-go/internal/util" -) - -func Main(_ []string, optPriv, optPub string) error { - priv, err := util.SignerFromHex(optPriv) - if err != nil { - return fmt.Errorf("cosign: %v", err) - } - b, err := hex.Deserialize(optPub) - if err != nil { - return fmt.Errorf("cosign: %v", err) - } - if len(b) != types.PublicKeySize { - return fmt.Errorf("cosign: invalid public key length %d", len(b)) - } - var pub types.PublicKey - copy(pub[:], b) - data, err := util.BytesFromStdin() - if err != nil { - return fmt.Errorf("cosign: %v", err) - } - var sth types.SignedTreeHead - if err := sth.FromASCII(bytes.NewBuffer(data)); err != nil { - return fmt.Errorf("cosign: %v", err) - } - witSTH, err := sth.TreeHead.Sign(priv, types.HashFn(pub[:])) - if err != nil { - return fmt.Errorf("cosign: %v", err) - } - - fmt.Printf("%s\n", hex.Serialize(witSTH.Signature[:])) - return nil -} -- cgit v1.2.3