pub struct BackupRecoveryKey { /* private fields */ }
Expand description
The private part of the backup key, the one used for recovery.
Implementations§
Source§impl BackupRecoveryKey
impl BackupRecoveryKey
Sourcepub fn new() -> Arc<Self>
pub fn new() -> Arc<Self>
Create a new random BackupRecoveryKey
.
Sourcepub fn from_base64(key: String) -> Result<Arc<Self>, DecodeError>
pub fn from_base64(key: String) -> Result<Arc<Self>, DecodeError>
Try to create a BackupRecoveryKey
from a base 64 encoded string.
Sourcepub fn from_base58(key: String) -> Result<Arc<Self>, DecodeError>
pub fn from_base58(key: String) -> Result<Arc<Self>, DecodeError>
Try to create a BackupRecoveryKey
from a base 58 encoded string.
Sourcepub fn new_from_passphrase(passphrase: String) -> Arc<Self>
pub fn new_from_passphrase(passphrase: String) -> Arc<Self>
Create a new BackupRecoveryKey
from the given passphrase.
Sourcepub fn from_passphrase(
passphrase: String,
salt: String,
rounds: i32,
) -> Arc<Self>
pub fn from_passphrase( passphrase: String, salt: String, rounds: i32, ) -> Arc<Self>
Restore a BackupRecoveryKey
from the given passphrase.
Sourcepub fn megolm_v1_public_key(&self) -> MegolmV1BackupKey
pub fn megolm_v1_public_key(&self) -> MegolmV1BackupKey
Get the public part of the backup key.
Sourcepub fn decrypt_v1(
&self,
ephemeral_key: String,
mac: String,
ciphertext: String,
) -> Result<String, PkDecryptionError>
pub fn decrypt_v1( &self, ephemeral_key: String, mac: String, ciphertext: String, ) -> Result<String, PkDecryptionError>
Try to decrypt a message that was encrypted using the public part of the backup key.
Trait Implementations§
Source§impl<UT> LiftRef<UT> for BackupRecoveryKey
impl<UT> LiftRef<UT> for BackupRecoveryKey
type LiftType = Arc<BackupRecoveryKey>
Source§impl<UT> LowerError<UT> for BackupRecoveryKey
impl<UT> LowerError<UT> for BackupRecoveryKey
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Lower this value for scaffolding function return Read more
Source§impl<UT> LowerReturn<UT> for BackupRecoveryKey
impl<UT> LowerReturn<UT> for BackupRecoveryKey
Source§type ReturnType = <Arc<BackupRecoveryKey> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<BackupRecoveryKey> as LowerReturn<UniFfiTag>>::ReturnType
The type that should be returned by scaffolding functions for this type. Read more
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustBuffer>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustBuffer>
Lower this value for scaffolding function return Read more
Source§impl<UT> TypeId<UT> for BackupRecoveryKey
impl<UT> TypeId<UT> for BackupRecoveryKey
Auto Trait Implementations§
impl Freeze for BackupRecoveryKey
impl RefUnwindSafe for BackupRecoveryKey
impl Send for BackupRecoveryKey
impl Sync for BackupRecoveryKey
impl Unpin for BackupRecoveryKey
impl UnwindSafe for BackupRecoveryKey
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
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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