-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add interface.export_pubkeys convenience function #278
Add interface.export_pubkeys convenience function #278
Conversation
Add package-wide constants for key types. NOTE: These values are still hard-coded in many places. We should switch to using these and probably other global constants in a separate PR.
Add convenience function to import multiple public keys of different key types from file into an sslib dict format at once, and tests. Note: Uses the new pseudo-standard docstring style suggested in secure-systems-lab/code-style-guidelines#20. All new interface functions should use that style (existing docstrings will be converted in separate PRs).
1 similar comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a question about where we are defining constants, but otherwise this looks like a nice addition. Thanks @lukpueh !
|
||
|
||
# Global constants | ||
# TODO: Replace hard-coded key types with these constants (and add more) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would these constants be better suited to the keys module? Is it worth documenting how we're choosing where to put constants?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO __init__
is a good default place for global constants. If we want to module-scope them, we should coordinate with #270.
Thanks for the quick review, @joshuagl! |
Fixes: # -
Related to in-toto/in-toto#80
Description of the changes being introduced by the pull request:
Add convenience function to import multiple public keys of different key types from file into an sslib dict format at once, and tests.
Note: Uses the new pseudo-standard docstring style suggested in secure-systems-lab/code-style-guidelines#20. All new interface functions should use that style (existing docstrings will be converted in separate PRs).
Note2: This PR also adds a few package-wide constants for key types, that are still hardcoded in many places. We should switch to using these and probably other global constants in a separate PR.
Please verify and check that the pull request fulfils the following requirements: