Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/cryptography/hazmat/primitives/serialization/__init__.py: 90%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

10 statements  

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 annotations 

6 

7from cryptography import utils 

8from cryptography.hazmat.primitives._serialization import ( 

9 BestAvailableEncryption, 

10 Encoding, 

11 KeySerializationEncryption, 

12 NoEncryption, 

13 ParameterFormat, 

14 PrivateFormat, 

15 PublicFormat, 

16 _KeySerializationEncryption, 

17) 

18from cryptography.hazmat.primitives.asymmetric.dh import _FFDH_DEPRECATION_MSG 

19from cryptography.hazmat.primitives.serialization.base import ( 

20 load_der_parameters, 

21 load_der_private_key, 

22 load_der_public_key, 

23 load_pem_parameters, 

24 load_pem_private_key, 

25 load_pem_public_key, 

26) 

27from cryptography.hazmat.primitives.serialization.ssh import ( 

28 SSHCertificate, 

29 SSHCertificateBuilder, 

30 SSHCertificateType, 

31 SSHCertPrivateKeyTypes, 

32 SSHCertPublicKeyTypes, 

33 SSHPrivateKeyTypes, 

34 SSHPublicKeyTypes, 

35 load_ssh_private_key, 

36 load_ssh_public_identity, 

37 load_ssh_public_key, 

38 ssh_key_fingerprint, 

39) 

40 

41__all__ = [ 

42 "BestAvailableEncryption", 

43 "Encoding", 

44 "KeySerializationEncryption", 

45 "NoEncryption", 

46 "ParameterFormat", 

47 "PrivateFormat", 

48 "PublicFormat", 

49 "SSHCertPrivateKeyTypes", 

50 "SSHCertPublicKeyTypes", 

51 "SSHCertificate", 

52 "SSHCertificateBuilder", 

53 "SSHCertificateType", 

54 "SSHPrivateKeyTypes", 

55 "SSHPublicKeyTypes", 

56 "_KeySerializationEncryption", 

57 "load_der_parameters", 

58 "load_der_private_key", 

59 "load_der_public_key", 

60 "load_pem_parameters", 

61 "load_pem_private_key", 

62 "load_pem_public_key", 

63 "load_ssh_private_key", 

64 "load_ssh_public_identity", 

65 "load_ssh_public_key", 

66 "ssh_key_fingerprint", 

67] 

68 

69# These can only load FFDH parameters, so the functions themselves are 

70# deprecated alongside the rest of FFDH. 

71utils.deprecated( 

72 load_pem_parameters, 

73 __name__, 

74 _FFDH_DEPRECATION_MSG, 

75 utils.DeprecatedIn50, 

76 name="load_pem_parameters", 

77) 

78 

79utils.deprecated( 

80 load_der_parameters, 

81 __name__, 

82 _FFDH_DEPRECATION_MSG, 

83 utils.DeprecatedIn50, 

84 name="load_der_parameters", 

85)