Trait btlib::crypto::CredStoreMut
source · pub trait CredStoreMut: CredStore {
// Required methods
fn gen_root_creds(&self, password: &str) -> Result<Self::CredHandle>;
fn import_root_creds(
&self,
password: &str,
exported: Self::ExportedCreds
) -> Result<Self::CredHandle>;
fn assign_node_writecap(
&self,
handle: &mut Self::CredHandle,
writecap: Writecap
) -> Result<()>;
fn assign_root_writecap(
&self,
handle: &mut Self::CredHandle,
writecap: Writecap
) -> Result<()>;
// Provided methods
fn provision_root(
&self,
password: &str,
expires: Epoch
) -> Result<Self::CredHandle> { ... }
fn provision_node_start(&self) -> Result<Principal> { ... }
fn provision_node_finish(
&self,
writecap: Writecap
) -> Result<Self::CredHandle> { ... }
}
Expand description
An extension of CredStore which exposes additional methods for mutating the credential store.
Required Methods§
sourcefn gen_root_creds(&self, password: &str) -> Result<Self::CredHandle>
fn gen_root_creds(&self, password: &str) -> Result<Self::CredHandle>
Generates the root credentials and protects them using the given password. If the root credentials have already been generated then an error is returned.
sourcefn import_root_creds(
&self,
password: &str,
exported: Self::ExportedCreds
) -> Result<Self::CredHandle>
fn import_root_creds( &self, password: &str, exported: Self::ExportedCreds ) -> Result<Self::CredHandle>
Imports root credentials that were previously created with CredStore::export_root_creds. The provided password must match the value that was given to that method.
sourcefn assign_node_writecap(
&self,
handle: &mut Self::CredHandle,
writecap: Writecap
) -> Result<()>
fn assign_node_writecap( &self, handle: &mut Self::CredHandle, writecap: Writecap ) -> Result<()>
sourcefn assign_root_writecap(
&self,
handle: &mut Self::CredHandle,
writecap: Writecap
) -> Result<()>
fn assign_root_writecap( &self, handle: &mut Self::CredHandle, writecap: Writecap ) -> Result<()>
Assigns writecap
to the root credentials referred to by handle
. This method
is responsible for committing the given Writecap to durable storage.
Provided Methods§
sourcefn provision_root(
&self,
password: &str,
expires: Epoch
) -> Result<Self::CredHandle>
fn provision_root( &self, password: &str, expires: Epoch ) -> Result<Self::CredHandle>
Generates new root credentials protected by password
and issues them a self-signed
Writecap which expires after valid_for
. The newly generated root credentials are
returned.
sourcefn provision_node_start(&self) -> Result<Principal>
fn provision_node_start(&self) -> Result<Principal>
sourcefn provision_node_finish(&self, writecap: Writecap) -> Result<Self::CredHandle>
fn provision_node_finish(&self, writecap: Writecap) -> Result<Self::CredHandle>
Assigns the given Writecap to the node credentials and commits it to durable storage. A handle to the node credentials is returned.