pub struct CryptoClient(pub(crate) CryptoClient);Tuple Fields§
§0: CryptoClientImplementations§
Source§impl CryptoClient
impl CryptoClient
Sourcepub async fn initialize_user_crypto(
&self,
req: InitUserCryptoRequest,
) -> Result<(), BitwardenError>
pub async fn initialize_user_crypto( &self, req: InitUserCryptoRequest, ) -> Result<(), BitwardenError>
Initialization method for the user crypto. Needs to be called before any other crypto operations.
Sourcepub async fn initialize_org_crypto(
&self,
req: InitOrgCryptoRequest,
) -> Result<(), BitwardenError>
pub async fn initialize_org_crypto( &self, req: InitOrgCryptoRequest, ) -> Result<(), BitwardenError>
Initialization method for the organization crypto. Needs to be called after
initialize_user_crypto but before any other crypto operations.
Sourcepub async fn get_user_encryption_key(&self) -> Result<B64, BitwardenError>
pub async fn get_user_encryption_key(&self) -> Result<B64, BitwardenError>
Get the uses’s decrypted encryption key. Note: It’s very important to keep this key safe, as it can be used to decrypt all of the user’s data
Sourcepub fn update_password(
&self,
new_password: String,
) -> Result<UpdatePasswordResponse, BitwardenError>
pub fn update_password( &self, new_password: String, ) -> Result<UpdatePasswordResponse, BitwardenError>
Create the data necessary to update the user’s password. The user’s encryption key is re-encrypted with the new password. This returns the new encrypted user key and the new password hash but does not update sdk state.
Note: This is deprecated and make_update_password should be used instead
Sourcepub fn make_update_password(
&self,
new_password: String,
) -> Result<UpdatePasswordResponse, BitwardenError>
pub fn make_update_password( &self, new_password: String, ) -> Result<UpdatePasswordResponse, BitwardenError>
Create the data necessary to update the user’s password. The user’s encryption key is re-encrypted with the new password. This returns the new encrypted user key and the new password hash but does not update sdk state.
Sourcepub fn derive_pin_key(
&self,
pin: String,
) -> Result<DerivePinKeyResponse, BitwardenError>
pub fn derive_pin_key( &self, pin: String, ) -> Result<DerivePinKeyResponse, BitwardenError>
Generates a PIN protected user key from the provided PIN. The result can be stored and later
used to initialize another client instance by using the PIN and the PIN key with
initialize_user_crypto.
Sourcepub fn derive_pin_user_key(
&self,
encrypted_pin: EncString,
) -> Result<EncString, BitwardenError>
pub fn derive_pin_user_key( &self, encrypted_pin: EncString, ) -> Result<EncString, BitwardenError>
Derives the pin protected user key from encrypted pin. Used when pin requires master password on first unlock.
Sourcepub fn enroll_pin(
&self,
pin: String,
) -> Result<EnrollPinResponse, BitwardenError>
pub fn enroll_pin( &self, pin: String, ) -> Result<EnrollPinResponse, BitwardenError>
Protects the current user key with the provided PIN. The result can be stored and later
used to initialize another client instance by using the PIN and the PIN key with
initialize_user_crypto.
Sourcepub fn enroll_pin_with_encrypted_pin(
&self,
encrypted_pin: EncString,
) -> Result<EnrollPinResponse, BitwardenError>
pub fn enroll_pin_with_encrypted_pin( &self, encrypted_pin: EncString, ) -> Result<EnrollPinResponse, BitwardenError>
Protects the current user key with the provided PIN. The result can be stored and later
used to initialize another client instance by using the PIN and the PIN key with
initialize_user_crypto. The provided pin is encrypted with the user key.
pub fn enroll_admin_password_reset( &self, public_key: B64, ) -> Result<UnsignedSharedKey, BitwardenError>
Sourcepub fn derive_key_connector(
&self,
request: DeriveKeyConnectorRequest,
) -> Result<B64, BitwardenError>
pub fn derive_key_connector( &self, request: DeriveKeyConnectorRequest, ) -> Result<B64, BitwardenError>
Derive the master key for migrating to the key connector
Sourcepub fn make_update_kdf(
&self,
password: String,
kdf: Kdf,
) -> Result<UpdateKdfResponse, BitwardenError>
pub fn make_update_kdf( &self, password: String, kdf: Kdf, ) -> Result<UpdateKdfResponse, BitwardenError>
Create the data necessary to update the user’s kdf settings. The user’s encryption key is re-encrypted for the password under the new kdf settings. This returns the new encrypted user key and the new password hash but does not update sdk state.
Trait Implementations§
Source§impl<UT> LiftRef<UT> for CryptoClient
impl<UT> LiftRef<UT> for CryptoClient
type LiftType = Arc<CryptoClient>
Source§impl<UT> LowerError<UT> for CryptoClient
impl<UT> LowerError<UT> for CryptoClient
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for CryptoClient
impl<UT> LowerReturn<UT> for CryptoClient
Source§type ReturnType = <Arc<CryptoClient> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<CryptoClient> as LowerReturn<UniFfiTag>>::ReturnType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl<UT> TypeId<UT> for CryptoClient
impl<UT> TypeId<UT> for CryptoClient
const TYPE_ID_META: MetadataBuffer
Auto Trait Implementations§
impl Freeze for CryptoClient
impl !RefUnwindSafe for CryptoClient
impl Send for CryptoClient
impl Sync for CryptoClient
impl Unpin for CryptoClient
impl !UnwindSafe for CryptoClient
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
§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
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more§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>
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>
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