Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/securesystemslib/signer/_constants.py: 100%

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

20 statements  

1"""Constants for supported key types and signing schemes. 

2 

3These are used throughout the ``securesystemslib.signer`` package instead of 

4hardcoded strings. The publicly registered key type and scheme pairs are listed 

5in ``securesystemslib.signer.KEY_FOR_TYPE_AND_SCHEME``. 

6""" 

7 

8#: RSA key type. 

9KEY_TYPE_RSA = "rsa" 

10 

11#: ECDSA key type. 

12KEY_TYPE_ECDSA = "ecdsa" 

13 

14#: Ed25519 key type. Note that Ed25519 is unsupported on many signer backends: 

15#: The payload cannot be hashed before signing so hardware tokens and cloud 

16#: KMSs generally do not support it because of payload size limitations. 

17KEY_TYPE_ED25519 = "ed25519" 

18 

19#: ML-DSA key type. Keytype defines pre-signing hashing with SHA-512. See 

20#: https://github.com/theupdateframework/taps/blob/master/tap21.md 

21KEY_TYPE_MLDSA = "ml-dsa" 

22 

23#: ECDSA signature scheme over NIST P-256 with SHA-256. Supported with key type 

24#: :data:`KEY_TYPE_ECDSA`. 

25ECDSA_SHA2_NISTP256 = "ecdsa-sha2-nistp256" 

26 

27#: ECDSA signature scheme over NIST P-384 with SHA-384. Supported with key type 

28#: :data:`KEY_TYPE_ECDSA`. 

29ECDSA_SHA2_NISTP384 = "ecdsa-sha2-nistp384" 

30 

31#: ECDSA signature scheme over NIST P-521 with SHA-512. Supported with key type 

32#: :data:`KEY_TYPE_ECDSA`. 

33ECDSA_SHA2_NISTP521 = "ecdsa-sha2-nistp521" 

34 

35#: RSASSA-PSS signature scheme with SHA-224. Supported with key type 

36#: :data:`KEY_TYPE_RSA`. 

37RSASSA_PSS_SHA224 = "rsassa-pss-sha224" 

38 

39#: RSASSA-PSS signature scheme with SHA-256. Supported with key type 

40#: :data:`KEY_TYPE_RSA`. 

41RSASSA_PSS_SHA256 = "rsassa-pss-sha256" 

42 

43#: RSASSA-PSS signature scheme with SHA-384. Supported with key type 

44#: :data:`KEY_TYPE_RSA`. 

45RSASSA_PSS_SHA384 = "rsassa-pss-sha384" 

46 

47#: RSASSA-PSS signature scheme with SHA-512. Supported with key type 

48#: :data:`KEY_TYPE_RSA`. 

49RSASSA_PSS_SHA512 = "rsassa-pss-sha512" 

50 

51#: RSA-PKCS#1 v1.5 signature scheme with SHA-224. Supported with key type 

52#: :data:`KEY_TYPE_RSA`. 

53RSA_PKCS1V15_SHA224 = "rsa-pkcs1v15-sha224" 

54 

55#: RSA-PKCS#1 v1.5 signature scheme with SHA-256. Supported with key type 

56#: :data:`KEY_TYPE_RSA`. 

57RSA_PKCS1V15_SHA256 = "rsa-pkcs1v15-sha256" 

58 

59#: RSA-PKCS#1 v1.5 signature scheme with SHA-384. Supported with key type 

60#: :data:`KEY_TYPE_RSA`. 

61RSA_PKCS1V15_SHA384 = "rsa-pkcs1v15-sha384" 

62 

63#: RSA-PKCS#1 v1.5 signature scheme with SHA-512. Supported with key type 

64#: :data:`KEY_TYPE_RSA`. 

65RSA_PKCS1V15_SHA512 = "rsa-pkcs1v15-sha512" 

66 

67#: Ed25519 pure signature scheme . Supported with key type :data:`KEY_TYPE_ED25519`. 

68ED25519 = "ed25519" 

69 

70#: ML-DSA-44 signature scheme. Supported with key type :data:`KEY_TYPE_MLDSA`. 

71MLDSA_44_1 = "ml-dsa-44/1" 

72 

73#: ML-DSA-65 signature scheme. Supported with key type :data:`KEY_TYPE_MLDSA`. 

74MLDSA_65_1 = "ml-dsa-65/1" 

75 

76#: ML-DSA-87 signature scheme. Supported with key type :data:`KEY_TYPE_MLDSA`. 

77MLDSA_87_1 = "ml-dsa-87/1"