pub struct DeviceKey(SymmetricCryptoKey);Expand description
Device Key
Encrypts the DevicePrivateKey Allows the device to decrypt the UserKey, via the DevicePrivateKey.
Tuple Fields§
§0: SymmetricCryptoKeyImplementations§
Source§impl DeviceKey
impl DeviceKey
Sourcepub fn trust_device(
user_key: &SymmetricCryptoKey,
) -> Result<TrustDeviceResponse, CryptoError>
pub fn trust_device( user_key: &SymmetricCryptoKey, ) -> Result<TrustDeviceResponse, CryptoError>
Generate a new device key
Note: Input has to be a SymmetricCryptoKey instead of UserKey because that’s what we get from EncSettings.
Sourcepub fn decrypt_user_key(
&self,
protected_device_private_key: EncString,
protected_user_key: UnsignedSharedKey,
) -> Result<SymmetricCryptoKey, CryptoError>
pub fn decrypt_user_key( &self, protected_device_private_key: EncString, protected_user_key: UnsignedSharedKey, ) -> Result<SymmetricCryptoKey, CryptoError>
Decrypt the user key using the device key
fn to_base64(&self) -> B64
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DeviceKey
impl RefUnwindSafe for DeviceKey
impl Send for DeviceKey
impl Sync for DeviceKey
impl Unpin for DeviceKey
impl UnwindSafe for DeviceKey
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<> Read moreSource§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