LocalCredentials

Struct LocalCredentials 

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

Persistent private-domain identity and epoch-zero key material.

Implementations§

Source§

impl LocalCredentials

Source

pub fn load(root: impl AsRef<Path>) -> Result<Self, SecurityError>

Loads an existing owner-only encrypted local key vault without creating files.

Source

pub fn load_or_create(root: impl AsRef<Path>) -> Result<Self, SecurityError>

Loads or creates an owner-only encrypted local key vault.

Source

pub fn create_for_domain( root: impl AsRef<Path>, seed: &DomainSeed, ) -> Result<Self, SecurityError>

Creates a new device identity in an existing trusted domain.

Source

pub fn signer(&self) -> IrohSigner

Returns the iroh endpoint signer used by this database.

Source

pub fn domain_key(&self) -> DomainKey

Returns the epoch-zero private-domain key.

Source

pub const fn domain_id(&self) -> DomainId

Returns the stable default private-domain ID.

Source

pub fn domain_seed(&self) -> DomainSeed

Exports sensitive domain bootstrap material for a trusted invitation flow.

Source

pub fn store_domain(&self, seed: &DomainSeed) -> Result<(), SecurityError>

Persists a domain seed in the owner-only encrypted device catalog.

Source

pub fn replace_domain(&self, seed: &DomainSeed) -> Result<(), SecurityError>

Atomically advances a catalog domain while retaining both epoch keys locally.

Source

pub fn load_domain( &self, domain_id: DomainId, ) -> Result<DomainSeed, SecurityError>

Loads one domain seed from the encrypted device catalog.

Source

pub fn load_domain_epoch( &self, domain_id: DomainId, epoch: u64, ) -> Result<DomainSeed, SecurityError>

Loads a retained historical epoch key without changing the active catalog entry.

Source

pub fn domains(&self) -> Result<Vec<DomainId>, SecurityError>

Lists every domain available to this device.

Source

pub fn endpoint_secret_key(&self) -> SecretKey

Returns the same secret identity used to authenticate the iroh endpoint.

Trait Implementations§

Source§

impl Clone for LocalCredentials

Source§

fn clone(&self) -> LocalCredentials

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 Debug for LocalCredentials

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl KeyProvider for LocalCredentials

Source§

fn signer(&self) -> IrohSigner

Returns the signer used for immutable database protocol objects.
Source§

fn endpoint_secret_key(&self) -> SecretKey

Returns the endpoint secret used by the iroh transport identity.
Source§

fn domain_id(&self) -> DomainId

Returns the provider’s default private domain identifier.
Source§

fn domain_seed(&self) -> DomainSeed

Returns the provider’s default private domain seed.
Source§

fn store_domain(&self, seed: &DomainSeed) -> Result<(), SecurityError>

Persists a newly attached domain seed.
Source§

fn stage_domain(&self, seed: &DomainSeed) -> Result<(), SecurityError>

Durably stages an adjacent epoch without activating it.
Source§

fn activate_domain(&self, seed: &DomainSeed) -> Result<(), SecurityError>

Atomically selects a retained domain epoch as active.
Source§

fn load_domain(&self, domain_id: DomainId) -> Result<DomainSeed, SecurityError>

Loads the active seed for one domain.
Source§

fn load_domain_epoch( &self, domain_id: DomainId, epoch: u64, ) -> Result<DomainSeed, SecurityError>

Loads one retained historical domain epoch.
Source§

fn domains(&self) -> Result<Vec<DomainId>, SecurityError>

Lists the domains available to this device.
Source§

fn domain_key(&self) -> DomainKey

Returns the stable default-domain key used for local authenticated metadata.

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.

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.