aboutsummaryrefslogtreecommitdiff
path: root/main.go
blob: 8d01333a0cfe7ee77ee5ef745d6a66a05c49b753 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package main

import (
	"crypto/rand"
	"encoding/base64"
	"flag"
	"fmt"
)

const (
	verFailed     = "signature verfication failed"
	verOK         = "Signature Verfied"
	DefaultRounds = 42
)

/*
	signify -C [-q] -p pubkey -x sigfile [file ...]
	signify -G [-n] [-c comment] -p pubkey -s seckey
	signify -S [-e] [-x sigfile] -s seckey -m message
	signify -V [-eq] [-x sigfile] -p pubkey -m message
*/

var (
	checksum = flag.Bool("C", false, "Verify a signed checksum list")
	generate = flag.Bool("G", false, "Generate a new key pair")
	sign     = flag.Bool("S", false, "Sign the specfied message")
	vefify   = flag.Bool("V", false, "Verify the message")
	comment  = flag.String("c", "", "Comment")
	embed    = flag.Bool("e", false, "Embed the message")
	msg      = flag.String("m", "", "Message file")
	nopass   = flag.Bool("n", false, "No key passphrase")
	pub      = flag.String("p", "", "Public key file")
	quiet    = flag.Bool("q", false, "Quiet mode")
	sec      = flag.String("s", "", "Secret key file")
	sig      = flag.String("x", "", "Signature file")
)

func main() {
	flag.Parse()

	var rounds = 42
	if *nopass {
		rounds = 0
	}
	_ = rounds

	/*
		if err := Generate(*pub, *sec, *comment, rounds); err != nil {
			log.Fatal(err)
		}
	*/

	s, _ := base64.StdEncoding.DecodeString("RWRCSwAAAACzJBN2gC5//jVvDiV76rs4m2aKXkljqDpbOC0bBf7abZhV/Zygr6b0KIbSI56JQutwzsQeouxnnHuVTZp3IW4M9qdpe5Nh8Jrr5g7r0rHLPxEPmcv/dNru6ZjqI7CcGsY=")
	fmt.Printf("%v\n", s)

	ss := &Sig{
		PKAlg: PKAlg,
	}
	rand.Read(ss.KeyNum[:])
	ms, _ := EncodeBase64(ss)
	fmt.Println(string(ms))
}