secure-systems-lab / securesystemslib

Cryptographic and general-purpose routines for Secure Systems Lab projects at NYU
MIT License
47 stars 49 forks source link

signer: add constants for key types and signing schemes #593

Open lukpueh opened 1 year ago

lukpueh commented 1 year ago

Supported key types and signing scheme strings are currently hardcoded all over the library. We should define them in a single place e.g. securesystemslib.signer._constants and update all secureystemslib.signer.* modules to use them. (I suggest to not touch legacy modules such as secureystemslib.keys)

Publicly registered key types and schemes can be found in: https://github.com/secure-systems-lab/securesystemslib/blob/135567fa04f10d0c6a4cd32eb45ce736e1f50a93/securesystemslib/signer/__init__.py#L39-L55

Additionally, there are a few non-registered ones, which ca be found by looking for implementations of the Key interface.

lukpueh commented 1 year ago

The 3 original key types are already defined as constants in init, which are only used in securesystemslib.interface. I suggest to deprecate them in favour of constants defined in the signer sub-package.