ToEncodableKey impls
tor-keymgr/src/keystore.rs
has impls of ToEncodableKey
for a whole bunch of key types, generally in terms of underlying actual key types.
-
IMO this is the wrong place. The place that defines a newtype for a key role should should provide the
ToEncodableKey
implementation. I think fixing this might involve separatingtor-keymgr
into two crates, one of which can exist below other crates. Alternatively, all oftor-keymgr
could be moved to belowtor-llcrypto
, but that doesn't seem right. -
The impls for these newtypes are very formulaic. They should be derived or provided via a blanket impl or helper trait impl or something.