def load_aead(self, public_id):
connection = self.engine.connect()<EOL>trans = connection.begin()<EOL>try:<EOL><INDENT>s = sqlalchemy.select([self.aead_table]).where(<EOL>(self.aead_table.c.public_id == public_id)<EOL>& self.aead_table.c.keyhandle.in_([kh[<NUM_LIT:1>] for kh in self.key_handles]))<EOL>result = connection.execute(s)<EOL>for row in result:<EOL><INDENT>kh_int = row['<STR_LIT>']<EOL>aead = pyhsm.aead_cmd.YHSM_GeneratedAEAD(None, kh_int, '<STR_LIT>')<EOL>aead.data = row['<STR_LIT>']<EOL>aead.nonce = row['<STR_LIT>']<EOL><DEDENT>return aead<EOL><DEDENT>except Exception as e:<EOL><INDENT>trans.rollback()<EOL>raise Exception("<STR_LIT>" % (public_id, str(e)))<EOL><DEDENT>finally:<EOL><INDENT>connection.close()<EOL><DEDENT>
Loads AEAD from the specified database.