예제 #1
0
파일: keydb.go 프로젝트: JonathanLogan/mute
// AddPublicKeyInit adds a public KeyInit message to keyDB.
func (keyDB *KeyDB) AddPublicKeyInit(ki *uid.KeyInit) error {
	_, err := keyDB.addPublicKeyInitQuery.Exec(ki.SigKeyHash(), ki.JSON())
	if err != nil {
		return err
	}
	return nil
}
예제 #2
0
파일: keydb.go 프로젝트: JonathanLogan/mute
// AddPrivateKeyInit adds a private KeyInit message and the corresponding
// server signature to keyDB.
func (keyDB *KeyDB) AddPrivateKeyInit(
	ki *uid.KeyInit,
	pubKeyHash, sigPubKey, privateKey, serverSignature string,
) error {
	_, err := keyDB.addPrivateKeyInitQuery.Exec(
		ki.SigKeyHash(),
		pubKeyHash,
		ki.JSON(),
		sigPubKey,
		privateKey,
		serverSignature,
	)
	if err != nil {
		return err
	}
	return nil
}