Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

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 

5 

6import abc 

7 

8 

9class AsymmetricSignatureContext(metaclass=abc.ABCMeta): 

10 @abc.abstractmethod 

11 def update(self, data): 

12 """ 

13 Processes the provided bytes and returns nothing. 

14 """ 

15 

16 @abc.abstractmethod 

17 def finalize(self): 

18 """ 

19 Returns the signature as bytes. 

20 """ 

21 

22 

23class AsymmetricVerificationContext(metaclass=abc.ABCMeta): 

24 @abc.abstractmethod 

25 def update(self, data): 

26 """ 

27 Processes the provided bytes and returns nothing. 

28 """ 

29 

30 @abc.abstractmethod 

31 def verify(self): 

32 """ 

33 Raises an exception if the bytes provided to update do not match the 

34 signature or the signature does not match the public key. 

35 """