Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/rsa/__init__.py: 80%

10 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2023-12-08 06:40 +0000

1# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> 

2# 

3# Licensed under the Apache License, Version 2.0 (the "License"); 

4# you may not use this file except in compliance with the License. 

5# You may obtain a copy of the License at 

6# 

7# https://www.apache.org/licenses/LICENSE-2.0 

8# 

9# Unless required by applicable law or agreed to in writing, software 

10# distributed under the License is distributed on an "AS IS" BASIS, 

11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

12# See the License for the specific language governing permissions and 

13# limitations under the License. 

14"""RSA module 

15 

16Module for calculating large primes, and RSA encryption, decryption, signing 

17and verification. Includes generating public and private keys. 

18 

19WARNING: this implementation does not use compression of the cleartext input to 

20prevent repetitions, or other common security improvements. Use with care. 

21 

22""" 

23 

24from rsa.key import newkeys, PrivateKey, PublicKey 

25from rsa.pkcs1 import ( 

26 encrypt, 

27 decrypt, 

28 sign, 

29 verify, 

30 DecryptionError, 

31 VerificationError, 

32 find_signature_hash, 

33 sign_hash, 

34 compute_hash, 

35) 

36 

37__author__ = "Sybren Stuvel, Barry Mead and Yesudeep Mangalapilly" 

38__date__ = "2022-07-20" 

39__version__ = "4.9" 

40 

41# Do doctest if we're run directly 

42if __name__ == "__main__": 

43 import doctest 

44 

45 doctest.testmod() 

46 

47__all__ = [ 

48 "newkeys", 

49 "encrypt", 

50 "decrypt", 

51 "sign", 

52 "verify", 

53 "PublicKey", 

54 "PrivateKey", 

55 "DecryptionError", 

56 "VerificationError", 

57 "find_signature_hash", 

58 "compute_hash", 

59 "sign_hash", 

60]