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 [-ez] [-x sigfile] -s seckey -m message signify -V [-eqz] [-p pubkey] [-t keytype] [-x sigfile] -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") gzip = flag.Bool("z", false, "Sign and verify gzip archives") ) 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, _ := Marshal(ss) fmt.Println(string(ms)) }