tor-keymgr: Add traits providing keystore access.
The reason for this change is twofold:
- it helps us keep the dummy
KeyMgr
implementation in sync with the "real" one: if we add new functions to any of these traits, we are forced to implement them for the dummyKeyMgr
too, because otherwise the--no-default-features
build of arti will fail to compile (when adding new functions toKeyMgr
, it's currently very easy to forget to add a corresponding implementation to the dummyKeyMgr
. In fact, the dummy implementation is currently missing a lot of the functions we have on the fully-featuredKeyMgr
). - it enables us to extend the keymgr with the ability to retrieve
non-key items, such as certificates, using accessors that have the
same name as the accessors for keys (i.e.
KeyMgr
will have twoget
functions:KeyMgr::get<K: ToEncodableKey>
, for retrieving keys, andKeyMgr::get<K::ToEncodableCert>
, for retrieving certs)