def perform_pubkey_add(self, intent):
async with self.connection.acquire() as conn:
async with conn.cursor() as cur:
try:
await cur.execute("INSERT INTO pubkeys VALUES (%s, %s);",
(intent.id, intent.key.decode()))
except IntegrityError:
raise PubKeyError('Identity `%s` already has a public key' % intent.id)
评论列表
文章目录