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) } }
func init() { votePrivateKey = keys.UnpackPrivateKey(config.LoadServerKey("voteKey")) config := config.Load() ballotKey = keys.UnpackKey(config.BallotServer.Key) }
func init() { ballotPrivateKey = keys.UnpackPrivateKey(config.LoadServerKey("ballotKey")) config := config.Load() voterListKey = keys.UnpackKey(config.VoterListServer.Key) }