pub struct DeviceKey(/* private fields */);Expand description
Device Key
Encrypts the DevicePrivateKey Allows the device to decrypt the UserKey, via the DevicePrivateKey.
Implementations§
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
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
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