package format import ( "fmt" "git.sigsum.org/sigsum-go/pkg/types" "git.sigsum.org/sigsum-tools-go/internal/util" "git.sigsum.org/sigsum-tools-go/pkg/policy" ) func Main(args []string, policy policy.Policy) error { if len(args) != 1 { return fmt.Errorf("format: must have one input file") } preimage, err := util.FileHash(args[0]) if err != nil { return fmt.Errorf("format: preparing checksum: %v", err) } stm := types.Statement{ ShardHint: policy.ShardHint(), Checksum: *types.HashFn(preimage[:]), } fmt.Printf("%s", stm.ToBinary()) return nil }