Skip to main content

StoreKeys

Struct StoreKeys 

Source
pub struct StoreKeys { /* private fields */ }
Expand description

One store’s key material: the encryption master key, cloud-home credentials, and OAuth tokens, each stored under a store-scoped keyring account ({base}:{store_id}). The store’s signing identity is not here — it goes through crate::identity_custody::IdentityCustody, the same way the master key goes through crate::custody::KeyCustody.

Implementations§

Source§

impl StoreKeys

Source

pub fn bind(store_id: String) -> Self

Source

pub fn store_id(&self) -> &str

Source

pub fn get_encryption_key(&self) -> Result<Option<String>, KeyError>

Source

pub fn set_encryption_key(&self, value: &str) -> Result<(), KeyError>

Source

pub fn delete_encryption_key(&self) -> Result<(), KeyError>

Source

pub fn get_cloud_home_credentials( &self, ) -> Result<Option<CloudHomeCredentials>, KeyError>

Source

pub fn set_cloud_home_credentials( &self, creds: &CloudHomeCredentials, ) -> Result<(), KeyError>

Source

pub fn get_cloud_home_oauth_tokens( &self, ) -> Result<Option<OAuthTokens>, KeyError>

Source

pub fn set_cloud_home_oauth_tokens( &self, tokens: &OAuthTokens, ) -> Result<(), KeyError>

Source

pub fn delete_cloud_home_credentials(&self) -> Result<(), KeyError>

Source

pub fn get_host_secret(&self, name: &str) -> Result<Option<String>, KeyError>

A host’s own store-scoped secret — an API token, a service credential — read from the same keyring service and access policy as coven’s own key material. None if never set. KeyError::InvalidSecretName if name collides with one of coven’s own reserved slot names, is empty, or contains : (see validate_host_secret_name).

Source

pub fn set_host_secret(&self, name: &str, value: &str) -> Result<(), KeyError>

Set a host’s own store-scoped secret. Same name restrictions as get_host_secret.

Source

pub fn delete_host_secret(&self, name: &str) -> Result<(), KeyError>

Remove a host secret. Ok whether or not one was set. Same name restrictions as get_host_secret.

Source

pub fn write_cloud_home_credentials_json_for_test( &self, json: &str, ) -> Result<(), KeyError>

Source

pub fn fail_next_cloud_home_credentials_operation_for_test( &self, error: Error, ) -> Result<(), KeyError>

Trait Implementations§

Source§

impl Clone for StoreKeys

Source§

fn clone(&self) -> StoreKeys

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl DeviceIdentityCustody for StoreKeys

Source§

fn unlock(&self) -> Result<Option<UserKeypair>, KeyError>

This store’s established signing identity. Ok(None) means none has ever been established — distinct from a failure to produce one (wrong passphrase, unreadable backing store), which is Err.
Source§

fn persist(&self, keypair: &UserKeypair) -> Result<(), KeyError>

Protect and store keypair, replacing whatever is stored. Idempotent.
Source§

fn forget(&self) -> Result<(), KeyError>

Remove the stored identity. Ok when nothing was stored.
Source§

fn establish(&self, keypair: &UserKeypair) -> Result<(), KeyError>

Establish this Store’s identity without replacing a different identity. Repeating the same identity is idempotent.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,