Example #1
0
// 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
}
Example #2
0
// 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
}