pub struct UserCryptoManagementClient {
pub(crate) client: Client,
}Expand description
Client for managing the cryptographic machinery of a user account, including key-rotation.
Fields§
§client: ClientImplementations§
Source§impl UserCryptoManagementClient
impl UserCryptoManagementClient
Sourcepub async fn migrate_to_key_connector(
&self,
key_connector_url: String,
) -> Result<(), MigrateToKeyConnectorError>
pub async fn migrate_to_key_connector( &self, key_connector_url: String, ) -> Result<(), MigrateToKeyConnectorError>
Migrates an initialized account to Key Connector unlock.
Requires the client to be unlocked so the current user key is available in memory.
Source§impl UserCryptoManagementClient
impl UserCryptoManagementClient
Sourcepub async fn password_change_and_rotate_user_keys(
&self,
request: PasswordChangeAndRotateUserKeysRequest,
) -> Result<(), RotateUserKeysError>
pub async fn password_change_and_rotate_user_keys( &self, request: PasswordChangeAndRotateUserKeysRequest, ) -> Result<(), RotateUserKeysError>
Combines a password change and user key rotation into a single request.
Before rotating, this checks whether the user’s public key encryption key pair needs regeneration and fixes it if necessary. This ensures that key rotation can proceed even if the existing private key is corrupt.
Source§impl UserCryptoManagementClient
impl UserCryptoManagementClient
Sourcepub async fn rotate_user_keys(
&self,
request: RotateUserKeysRequest,
) -> Result<(), RotateUserKeysError>
pub async fn rotate_user_keys( &self, request: RotateUserKeysRequest, ) -> Result<(), RotateUserKeysError>
Rotates the user’s encryption keys without a password change.
Source§impl UserCryptoManagementClient
impl UserCryptoManagementClient
Sourcepub async fn get_untrusted_organization_public_keys(
&self,
) -> Result<Vec<V1OrganizationMembership>, RotateUserKeysError>
pub async fn get_untrusted_organization_public_keys( &self, ) -> Result<Vec<V1OrganizationMembership>, RotateUserKeysError>
Fetches the organization public keys for V1 organization memberships for the user for organizations for which reset password is enrolled. These have to be trusted manually be the user before rotating.
Sourcepub async fn get_untrusted_emergency_access_public_keys(
&self,
) -> Result<Vec<V1EmergencyAccessMembership>, RotateUserKeysError>
pub async fn get_untrusted_emergency_access_public_keys( &self, ) -> Result<Vec<V1EmergencyAccessMembership>, RotateUserKeysError>
Fetches the emergency access public keys for V1 emergency access memberships for the user. These have to be trusted manually be the user before rotating.
Source§impl UserCryptoManagementClient
impl UserCryptoManagementClient
Sourcepub fn pin_settings(&self) -> PinSettingsClient
pub fn pin_settings(&self) -> PinSettingsClient
Returns the PIN settings sub-client.
Source§impl UserCryptoManagementClient
impl UserCryptoManagementClient
Sourcepub async fn regenerate_public_key_encryption_key_pair_if_needed(
&self,
) -> Result<bool, KeyPairRegenerationError>
pub async fn regenerate_public_key_encryption_key_pair_if_needed( &self, ) -> Result<bool, KeyPairRegenerationError>
Checks whether the user’s public key encryption key pair needs regeneration, and if so, generates a new key pair and submits it to the server.
If regeneration is performed, the updated [WrappedAccountCryptographicState] is
persisted via the state bridge (when registered).
Requires the client to be unlocked so the current user key is available in memory. Only applicable to V1 encryption accounts.
Sourcepub async fn should_regenerate_public_key_encryption_key_pair(
&self,
) -> Result<bool, KeyPairRegenerationError>
pub async fn should_regenerate_public_key_encryption_key_pair( &self, ) -> Result<bool, KeyPairRegenerationError>
Checks whether the user’s public key encryption key pair needs regeneration.
Returns true if the key pair is missing, corrupt, or doesn’t match the public key on
the server. Returns false if the key pair is valid or if regeneration is not applicable
(e.g., user key not available, V2 encryption account).
Sourcepub(crate) async fn regenerate_public_key_encryption_key_pair_if_needed_with_ciphers(
&self,
ciphers: &[Cipher],
) -> Result<Option<WrappedAccountCryptographicState>, KeyPairRegenerationError>
pub(crate) async fn regenerate_public_key_encryption_key_pair_if_needed_with_ciphers( &self, ciphers: &[Cipher], ) -> Result<Option<WrappedAccountCryptographicState>, KeyPairRegenerationError>
Variant of Self::regenerate_public_key_encryption_key_pair_if_needed that accepts
pre-fetched ciphers instead of fetching them from the API.
Returns None if no regeneration was needed, or the updated
[WrappedAccountCryptographicState] read from the key store after regeneration.
Trait Implementations§
Source§impl Clone for UserCryptoManagementClient
impl Clone for UserCryptoManagementClient
Source§fn clone(&self) -> UserCryptoManagementClient
fn clone(&self) -> UserCryptoManagementClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl From<UserCryptoManagementClient> for JsValue
impl From<UserCryptoManagementClient> for JsValue
Source§fn from(value: UserCryptoManagementClient) -> Self
fn from(value: UserCryptoManagementClient) -> Self
Source§impl<UT> LiftRef<UT> for UserCryptoManagementClient
impl<UT> LiftRef<UT> for UserCryptoManagementClient
Source§impl<UT> LowerError<UT> for UserCryptoManagementClient
impl<UT> LowerError<UT> for UserCryptoManagementClient
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for UserCryptoManagementClient
impl<UT> LowerReturn<UT> for UserCryptoManagementClient
Source§type ReturnType = <Arc<UserCryptoManagementClient> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<UserCryptoManagementClient> 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 RefFromWasmAbi for UserCryptoManagementClient
impl RefFromWasmAbi for UserCryptoManagementClient
Source§type Anchor = RcRef<UserCryptoManagementClient>
type Anchor = RcRef<UserCryptoManagementClient>
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl<UT> TypeId<UT> for UserCryptoManagementClient
impl<UT> TypeId<UT> for UserCryptoManagementClient
const TYPE_ID_META: MetadataBuffer
Source§impl VectorFromWasmAbi for UserCryptoManagementClient
impl VectorFromWasmAbi for UserCryptoManagementClient
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[UserCryptoManagementClient]>
Source§impl VectorIntoWasmAbi for UserCryptoManagementClient
impl VectorIntoWasmAbi for UserCryptoManagementClient
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[UserCryptoManagementClient]>) -> Self::Abi
impl SupportsConstructor for UserCryptoManagementClient
impl SupportsInstanceProperty for UserCryptoManagementClient
impl SupportsStaticProperty for UserCryptoManagementClient
Auto Trait Implementations§
impl Freeze for UserCryptoManagementClient
impl !RefUnwindSafe for UserCryptoManagementClient
impl Send for UserCryptoManagementClient
impl Sync for UserCryptoManagementClient
impl Unpin for UserCryptoManagementClient
impl UnsafeUnpin for UserCryptoManagementClient
impl !UnwindSafe for UserCryptoManagementClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.