def test_generate_aead_simple_validates(self):
        # To successfully decrypt the AEAD we have to generate and decrypt
        # with the same key handle. Key handle 0x2000 has all flags set.
        kh_gen = 0x2000
        kh_val = 0x2000

        aead = self.hsm.generate_aead_simple('', kh_gen, self.secret)

        # test that the YubiHSM validates the generated AEAD
        # and confirms it contains our secret
        self.assertTrue(self.hsm.validate_aead(aead.nonce, kh_val, \
                                                   aead, cleartext = self.secret.pack()))
Test validate_aead of generate_aead_simple result.
dataset/ETHPy150Open Yubico/python-pyhsm/test/test_aead.py/TestAEAD.test_generate_aead_simple_validates