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§
Sourcefn signer(&self) -> IrohSigner
fn signer(&self) -> IrohSigner
Returns the signer used for immutable database protocol objects.
Sourcefn endpoint_secret_key(&self) -> SecretKey
fn endpoint_secret_key(&self) -> SecretKey
Returns the endpoint secret used by the iroh transport identity.
Sourcefn domain_seed(&self) -> DomainSeed
fn domain_seed(&self) -> DomainSeed
Returns the provider’s default private domain seed.
Sourcefn store_domain(&self, seed: &DomainSeed) -> Result<(), SecurityError>
fn store_domain(&self, seed: &DomainSeed) -> Result<(), SecurityError>
Persists a newly attached domain seed.
Sourcefn stage_domain(&self, seed: &DomainSeed) -> Result<(), SecurityError>
fn stage_domain(&self, seed: &DomainSeed) -> Result<(), SecurityError>
Durably stages an adjacent epoch without activating it.
Sourcefn activate_domain(&self, seed: &DomainSeed) -> Result<(), SecurityError>
fn activate_domain(&self, seed: &DomainSeed) -> Result<(), SecurityError>
Atomically selects a retained domain epoch as active.
Sourcefn load_domain(&self, domain_id: DomainId) -> Result<DomainSeed, SecurityError>
fn load_domain(&self, domain_id: DomainId) -> Result<DomainSeed, SecurityError>
Loads the active seed for one domain.
Sourcefn load_domain_epoch(
&self,
domain_id: DomainId,
epoch: u64,
) -> Result<DomainSeed, SecurityError>
fn load_domain_epoch( &self, domain_id: DomainId, epoch: u64, ) -> Result<DomainSeed, SecurityError>
Loads one retained historical domain epoch.
Sourcefn domains(&self) -> Result<Vec<DomainId>, SecurityError>
fn domains(&self) -> Result<Vec<DomainId>, SecurityError>
Lists the domains available to this device.
Provided Methods§
Sourcefn domain_key(&self) -> DomainKey
fn domain_key(&self) -> DomainKey
Returns the stable default-domain key used for local authenticated metadata.