Skip to content

keymgr: Move ssh-related functions out of EncodableKey.

gabi-250 requested to merge gabi-250/arti:keymgr-enc-key-refactor into main

EncodableKey is supposed to be format-agnostic. This moves the functionality related to OpenSSH encoding to the new SshEncodableKey trait. This commit also removes the EncodableKey::to_bytes function, because not all keys have a canonical byte representation.

This a temporary solution for #965 (closed). It's not ideal, because users still can't use KeyMgr with custom key encoding formats (EncodableKey needs to know all supported encoding formats ahead of time, and provide an as_<custom_format>() method for each of them).

In the long-term, we should consider providing some APIs to enable Keystores to downcast &dyn EncodableKeys to the appropriate user-provided type/trait object.

Merge request reports

Loading