def verify(self, data, signature): expected = uacrypto.hmac_sha256(self.key, data) if signature != expected: raise uacrypto.InvalidSignature
def signature(self, data): return uacrypto.hmac_sha256(self.key, data)