summaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src/mgr.rs
Commit message (Collapse)AuthorAgeFilesLines
* keymgr: Rename KeyStore to Keystore globally.Gabriela Moldovan2023-06-291-6/+6
| | | | | We've been capitalizing the "s" in "KeyStore" inconsistently. This `s/KeyStore/Keystore/g` across the codebase.
* keymgr: Downgrade "TODO hs" to "TODO HSS".Gabriela Moldovan2023-06-281-2/+2
| | | | | These TODOs can be deferred for now: we're not declaring the keymgr APIs stable until we add support for hidden services.
* keymgr: Replace Error with Box<dyn KeystoreError>.Gabriela Moldovan2023-06-261-3/+3
| | | | Part of #901
* keymgr: Downgrade 2 "TODO hs" to "TODO HSS".Gabriela Moldovan2023-06-221-1/+1
|
* keymgr: Remove Error::NotFound, update KeyMgr, KeyStore APIs.Gabriela Moldovan2023-06-211-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the `NotFound` `tor_keymgr::Error` variant. Since `KeyMgr` and `KeyStore` users will need to be able to distinguish between "not found" errors and other I/O errors, this also changes the return types of the `get()` and `remove()` functions of `KeyStore` and `KeyMgr`, which now return `Ok(None)` instead of `Error::NotFound`. This makes the `KeyStore` API consistent with `KeyMgr::get`, which already has a return type of `Result<Option<K>>` (rather than `Result<K>`). This also prepares us for #901, which will make key store errors opaque. Without this change: * we'd have to create a `struct NotFoundError;` error type. Its `HasKind` impl would need to return a new `ErrorKind::KeyStoreErrorNotFound` `ErrorKind` variant * callers would have to match the `error_kind()` of the error to figure out whether the key simply can't be found (`ErrorKind::KeyStoreErrorNotFound`), or if something went wrong (any other `ErrorKind`). Given the above, I think `Result<Option<()>>` makes for a more ergonomic API. Part of #901
* keymgr: Defer key bundle support until "Basic Service" milestone.Gabriela Moldovan2023-06-201-1/+1
| | | | We don't really need "key bundles" for the client keys.
* keymgr, arti-client: KeyMgr should return Ok(None) if the key is not found.Gabriela Moldovan2023-06-151-4/+4
| | | | | | | This simplifies usage quite a bit and will enable us to implement a dummy `KeyMgr` that doesn't depend on the error types from tor-keymgr (which will replace the "real" `KeyMgr` if the keymgr feature is disabled).
* keymgr: Introduce ToEncodableKey to simplify lookups.Gabriela Moldovan2023-06-151-12/+11
| | | | | | | This means `KeyMgr` users don't need to specify the underlying key type (e.g. `ed25519::Keypair`) when retrieving keys. Instead, they can just specify the type required (as long as it implements `ToEncodableKey`), e.g. `HsClientIntroAuthKeypair`.
* keymgr: Add key manager implementation stub.Gabriela Moldovan2023-06-151-0/+112