示例#1
0
func init() {

	// Load the singing key
	// TODO: load from election config file
	voterListKey := keys.UnpackPrivateKey(config.LoadServerKey("voterListKey"))
	config := config.Load()
	for _, voter := range config.Voters {
		voterKey, err := proto.Marshal(voter.Key)
		if err != nil {
			panic(err)
		}
		sig, err := sign.Sign(voterListKey, voterKey)
		if err != nil {
			panic(err)
		}
		voterKeys[string(voterKey)] = sig
		fmt.Printf("Added voter %s.\n", *voter.Name)
	}
}
示例#2
0
func init() {
	votePrivateKey = keys.UnpackPrivateKey(config.LoadServerKey("voteKey"))
	config := config.Load()
	ballotKey = keys.UnpackKey(config.BallotServer.Key)
}
示例#3
0
func init() {
	ballotPrivateKey = keys.UnpackPrivateKey(config.LoadServerKey("ballotKey"))
	config := config.Load()
	voterListKey = keys.UnpackKey(config.VoterListServer.Key)
}