KeyProvider

Trait KeyProvider 

Source
pub trait KeyProvider: Send + Sync {
    // Required methods
    fn signer(&self) -> IrohSigner;
    fn endpoint_secret_key(&self) -> SecretKey;
    fn domain_id(&self) -> DomainId;
    fn domain_seed(&self) -> DomainSeed;
    fn store_domain(&self, seed: &DomainSeed) -> Result<(), SecurityError>;
    fn stage_domain(&self, seed: &DomainSeed) -> Result<(), SecurityError>;
    fn activate_domain(&self, seed: &DomainSeed) -> Result<(), SecurityError>;
    fn load_domain(
        &self,
        domain_id: DomainId,
    ) -> Result<DomainSeed, SecurityError>;
    fn load_domain_epoch(
        &self,
        domain_id: DomainId,
        epoch: u64,
    ) -> Result<DomainSeed, SecurityError>;
    fn domains(&self) -> Result<Vec<DomainId>, SecurityError>;

    // Provided method
    fn domain_key(&self) -> DomainKey { ... }
}
Expand description

Application-supplied durable device identity and encrypted domain-key storage.

Implementations must make catalog updates durable before returning and must never return a key for a different domain or epoch than requested.

Required Methods§

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.

Provided Methods§

Source

fn domain_key(&self) -> DomainKey

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

Implementors§