Make keymgr APIs less error prone by not using Box<dyn Any>
In !1337 (merged), we fixed a bug where read_ed25519_keypair
would always return a type-erased ()
instead of a Ed25519Keypair
due to a misplaced ;
. Normally this sort of issue is prevented by type-checking, but in this case it wasn't because the return type of read_ed25519_keypair
is (essentially) Box<dyn Any>
.
We may be able to prevent this sort of error from happening again by changing the keymgr APIs to represent type-erased keys using a new StoredKey
/ManagedKey
trait instead of ErasedKey
(i.e. Box<dyn Any>
).
Edited by gabi-250