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§

source

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.

source

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.

source

fn assign_node_writecap( &self, handle: &mut Self::CredHandle, writecap: Writecap ) -> Result<()>

Assigns the given Writecap to the node credentials referred to by the given handle. This method is responsible for committing the given Writecap to durable storage.

source

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§

source

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.

source

fn provision_node_start(&self) -> Result<Principal>

Begin the provisioning process for a node by generating a new set of node credentials. The Principal of the newly generated credentials is returned. This Principal may then be transmitted to a root node which can use it to issue a Writecap to this node.

source

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.

Implementors§