pub struct ArtiNativeKeystore {
keystore_dir: CheckedDir,
id: KeystoreId,
}
keymgr
only.Expand description
The Arti key store.
This is a disk-based key store that encodes keys in OpenSSH format.
Some of the key types supported by the ArtiNativeKeystore
don’t have a predefined SSH public key algorithm name,
so we define several custom SSH algorithm names.
As per RFC4251 § 6, our custom SSH algorithm names use the
<something@subdomain.torproject.org>
format.
We have assigned the following custom algorithm names:
x25519@spec.torproject.org
, for x25519 keysed25519-expanded@spec.torproject.org
, for expanded ed25519 keys
See SSH protocol extensions for more details.
Fields§
§keystore_dir: CheckedDir
The root of the key store.
All the keys are stored within this directory.
id: KeystoreId
The unique identifier of this instance.
Implementations§
Source§impl ArtiNativeKeystore
impl ArtiNativeKeystore
Sourcepub fn from_path_and_mistrust(
keystore_dir: impl AsRef<Path>,
mistrust: &Mistrust,
) -> Result<Self>
pub fn from_path_and_mistrust( keystore_dir: impl AsRef<Path>, mistrust: &Mistrust, ) -> Result<Self>
Create a new ArtiNativeKeystore
rooted at the specified keystore_dir
directory.
The keystore_dir
directory is created if it doesn’t exist.
This function returns an error if keystore_dir
is not a directory, if it does not conform
to the requirements of the specified Mistrust
, or if there was a problem creating the
directory.
Sourcefn rel_path(
&self,
key_spec: &dyn KeySpecifier,
item_type: &KeystoreItemType,
) -> StdResult<RelKeyPath<'_>, ArtiPathUnavailableError>
fn rel_path( &self, key_spec: &dyn KeySpecifier, item_type: &KeystoreItemType, ) -> StdResult<RelKeyPath<'_>, ArtiPathUnavailableError>
The path on disk of the key with the specified identity and type, relative to
keystore_dir
.
Trait Implementations§
Source§impl Debug for ArtiNativeKeystore
impl Debug for ArtiNativeKeystore
Source§impl Keystore for ArtiNativeKeystore
impl Keystore for ArtiNativeKeystore
Source§fn id(&self) -> &KeystoreId
fn id(&self) -> &KeystoreId
Source§fn contains(
&self,
key_spec: &dyn KeySpecifier,
item_type: &KeystoreItemType,
) -> Result<bool>
fn contains( &self, key_spec: &dyn KeySpecifier, item_type: &KeystoreItemType, ) -> Result<bool>
key_spec
exists in this key store.Source§fn get(
&self,
key_spec: &dyn KeySpecifier,
item_type: &KeystoreItemType,
) -> Result<Option<ErasedKey>>
fn get( &self, key_spec: &dyn KeySpecifier, item_type: &KeystoreItemType, ) -> Result<Option<ErasedKey>>
key_spec
. Read moreSource§fn insert(
&self,
key: &dyn EncodableItem,
key_spec: &dyn KeySpecifier,
) -> Result<()>
fn insert( &self, key: &dyn EncodableItem, key_spec: &dyn KeySpecifier, ) -> Result<()>
key
to the key store.Auto Trait Implementations§
impl Freeze for ArtiNativeKeystore
impl RefUnwindSafe for ArtiNativeKeystore
impl Send for ArtiNativeKeystore
impl Sync for ArtiNativeKeystore
impl Unpin for ArtiNativeKeystore
impl UnwindSafe for ArtiNativeKeystore
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more