pub struct DeviceManager { /* private fields */ }Expand description
Manages the access point that protects the device signing key.
Call DeviceManager::sign_out to lock the device vault.
Implementations§
Source§impl DeviceManager
impl DeviceManager
Sourcepub async fn new(
target: &BackendTarget,
account_id: &AccountId,
signer: DeviceSigner,
password: &AccessKey,
) -> Result<DeviceManager, Error>
pub async fn new( target: &BackendTarget, account_id: &AccountId, signer: DeviceSigner, password: &AccessKey, ) -> Result<DeviceManager, Error>
Create a new device manager from a signer.
Sourcepub async fn open_vault(
target: BackendTarget,
vault: Vault,
access_key: &AccessKey,
) -> Result<(DeviceManager, Uuid), Error>
pub async fn open_vault( target: BackendTarget, vault: Vault, access_key: &AccessKey, ) -> Result<(DeviceManager, Uuid), Error>
Load a device manager from an existing vault.
Sourcepub async fn into_vault_buffer(self) -> Result<Vec<u8>, Error>
pub async fn into_vault_buffer(self) -> Result<Vec<u8>, Error>
Consume this device manager into a buffer of the vault.
Sourcepub fn current_device(
&self,
extra_info: Option<DeviceMetaData>,
) -> TrustedDevice
pub fn current_device( &self, extra_info: Option<DeviceMetaData>, ) -> TrustedDevice
Current device information.
Auto Trait Implementations§
impl Freeze for DeviceManager
impl !RefUnwindSafe for DeviceManager
impl Send for DeviceManager
impl Sync for DeviceManager
impl Unpin for DeviceManager
impl !UnwindSafe for DeviceManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more