1# This file is dual licensed under the terms of the Apache License, Version 2# 2.0, and the BSD License. See the LICENSE file in the root of this repository 3# for complete details. 4 5from __future__ import absolute_import, division, print_function 6 7import abc 8 9import six 10 11 12@six.add_metaclass(abc.ABCMeta) 13class AsymmetricSignatureContext(object): 14 @abc.abstractmethod 15 def update(self, data): 16 """ 17 Processes the provided bytes and returns nothing. 18 """ 19 20 @abc.abstractmethod 21 def finalize(self): 22 """ 23 Returns the signature as bytes. 24 """ 25 26 27@six.add_metaclass(abc.ABCMeta) 28class AsymmetricVerificationContext(object): 29 @abc.abstractmethod 30 def update(self, data): 31 """ 32 Processes the provided bytes and returns nothing. 33 """ 34 35 @abc.abstractmethod 36 def verify(self): 37 """ 38 Raises an exception if the bytes provided to update do not match the 39 signature or the signature does not match the public key. 40 """ 41