pub struct IronOxide { /* private fields */ }
Expand description
Primary SDK Object
Struct that is used to make authenticated requests to the IronCore API. Instantiated with the details of an account’s various ids, device, and signing keys. Once instantiated all operations will be performed in the context of the account provided.
Implementations§
Source§impl IronOxide
impl IronOxide
Sourcepub fn device(&self) -> &DeviceContext
pub fn device(&self) -> &DeviceContext
DeviceContext that was used to create this SDK instance
Sourcepub fn clear_policy_cache(&self) -> usize
pub fn clear_policy_cache(&self) -> usize
Clears all entries from the policy cache.
Returns the number of entries cleared from the cache.
Sourcepub async fn rotate_all(
&self,
rotations: &PrivateKeyRotationCheckResult,
password: &str,
timeout: Option<Duration>,
) -> Result<(Option<UserUpdatePrivateKeyResult>, Option<Vec<GroupUpdatePrivateKeyResult>>)>
pub async fn rotate_all( &self, rotations: &PrivateKeyRotationCheckResult, password: &str, timeout: Option<Duration>, ) -> Result<(Option<UserUpdatePrivateKeyResult>, Option<Vec<GroupUpdatePrivateKeyResult>>)>
Rotate the private key of the calling user and all groups they are an administrator of where needs_rotation is true. Note that this function has the potential to take much longer than other functions, as rotation will be done individually on each user/group. If rotation is only needed for a specific group, it is strongly recommended to call user_rotate_private_key or group_rotate_private_key instead.
§Arguments
rotations
- PrivateKeyRotationCheckResult that holds all users and groups to be rotatedpassword
- Password to unlock the current user’s user master keytimeout
- timeout for rotate_all. This is a separate timeout from the SDK-wide timeout as it is expected that this operation might take significantly longer than other operations.
Trait Implementations§
Source§impl BlindIndexSearchInitialize for IronOxide
impl BlindIndexSearchInitialize for IronOxide
Source§async fn create_blind_index(
&self,
group_id: &GroupId,
) -> Result<EncryptedBlindIndexSalt>
async fn create_blind_index( &self, group_id: &GroupId, ) -> Result<EncryptedBlindIndexSalt>
Source§impl DocumentAdvancedOps for IronOxide
impl DocumentAdvancedOps for IronOxide
Source§async fn document_encrypt_unmanaged(
&self,
data: Vec<u8>,
encrypt_opts: &DocumentEncryptOpts,
) -> Result<DocumentEncryptUnmanagedResult>
async fn document_encrypt_unmanaged( &self, data: Vec<u8>, encrypt_opts: &DocumentEncryptOpts, ) -> Result<DocumentEncryptUnmanagedResult>
Source§async fn document_decrypt_unmanaged(
&self,
encrypted_data: &[u8],
encrypted_deks: &[u8],
) -> Result<DocumentDecryptUnmanagedResult>
async fn document_decrypt_unmanaged( &self, encrypted_data: &[u8], encrypted_deks: &[u8], ) -> Result<DocumentDecryptUnmanagedResult>
Source§impl DocumentOps for IronOxide
impl DocumentOps for IronOxide
Source§async fn document_encrypt(
&self,
document_data: Vec<u8>,
encrypt_opts: &DocumentEncryptOpts,
) -> Result<DocumentEncryptResult>
async fn document_encrypt( &self, document_data: Vec<u8>, encrypt_opts: &DocumentEncryptOpts, ) -> Result<DocumentEncryptResult>
Source§async fn document_decrypt(
&self,
encrypted_document: &[u8],
) -> Result<DocumentDecryptResult>
async fn document_decrypt( &self, encrypted_document: &[u8], ) -> Result<DocumentDecryptResult>
Source§async fn document_list(&self) -> Result<DocumentListResult>
async fn document_list(&self) -> Result<DocumentListResult>
Source§async fn document_get_metadata(
&self,
id: &DocumentId,
) -> Result<DocumentMetadataResult>
async fn document_get_metadata( &self, id: &DocumentId, ) -> Result<DocumentMetadataResult>
Source§fn document_get_id_from_bytes(
&self,
encrypted_document: &[u8],
) -> Result<DocumentId>
fn document_get_id_from_bytes( &self, encrypted_document: &[u8], ) -> Result<DocumentId>
Source§async fn document_update_bytes(
&self,
id: &DocumentId,
new_document_data: Vec<u8>,
) -> Result<DocumentEncryptResult>
async fn document_update_bytes( &self, id: &DocumentId, new_document_data: Vec<u8>, ) -> Result<DocumentEncryptResult>
Source§async fn document_update_name(
&self,
id: &DocumentId,
name: Option<&DocumentName>,
) -> Result<DocumentMetadataResult>
async fn document_update_name( &self, id: &DocumentId, name: Option<&DocumentName>, ) -> Result<DocumentMetadataResult>
Source§async fn document_grant_access(
&self,
id: &DocumentId,
grant_list: &[UserOrGroup],
) -> Result<DocumentAccessResult>
async fn document_grant_access( &self, id: &DocumentId, grant_list: &[UserOrGroup], ) -> Result<DocumentAccessResult>
Source§async fn document_revoke_access(
&self,
id: &DocumentId,
revoke_list: &[UserOrGroup],
) -> Result<DocumentAccessResult>
async fn document_revoke_access( &self, id: &DocumentId, revoke_list: &[UserOrGroup], ) -> Result<DocumentAccessResult>
Source§impl GroupOps for IronOxide
impl GroupOps for IronOxide
Source§async fn group_create(
&self,
opts: &GroupCreateOpts,
) -> Result<GroupCreateResult>
async fn group_create( &self, opts: &GroupCreateOpts, ) -> Result<GroupCreateResult>
Source§async fn group_get_metadata(&self, id: &GroupId) -> Result<GroupGetResult>
async fn group_get_metadata(&self, id: &GroupId) -> Result<GroupGetResult>
Source§async fn group_list(&self) -> Result<GroupListResult>
async fn group_list(&self) -> Result<GroupListResult>
Source§async fn group_update_name(
&self,
id: &GroupId,
name: Option<&GroupName>,
) -> Result<GroupMetaResult>
async fn group_update_name( &self, id: &GroupId, name: Option<&GroupName>, ) -> Result<GroupMetaResult>
Source§async fn group_rotate_private_key(
&self,
id: &GroupId,
) -> Result<GroupUpdatePrivateKeyResult>
async fn group_rotate_private_key( &self, id: &GroupId, ) -> Result<GroupUpdatePrivateKeyResult>
Source§async fn group_add_members(
&self,
id: &GroupId,
grant_list: &[UserId],
) -> Result<GroupAccessEditResult>
async fn group_add_members( &self, id: &GroupId, grant_list: &[UserId], ) -> Result<GroupAccessEditResult>
Source§async fn group_remove_members(
&self,
id: &GroupId,
revoke_list: &[UserId],
) -> Result<GroupAccessEditResult>
async fn group_remove_members( &self, id: &GroupId, revoke_list: &[UserId], ) -> Result<GroupAccessEditResult>
Source§async fn group_add_admins(
&self,
id: &GroupId,
users: &[UserId],
) -> Result<GroupAccessEditResult>
async fn group_add_admins( &self, id: &GroupId, users: &[UserId], ) -> Result<GroupAccessEditResult>
Source§async fn group_remove_admins(
&self,
id: &GroupId,
revoke_list: &[UserId],
) -> Result<GroupAccessEditResult>
async fn group_remove_admins( &self, id: &GroupId, revoke_list: &[UserId], ) -> Result<GroupAccessEditResult>
Source§impl UserOps for IronOxide
impl UserOps for IronOxide
Source§async fn user_create(
jwt: &Jwt,
password: &str,
user_create_opts: &UserCreateOpts,
timeout: Option<Duration>,
) -> Result<UserCreateResult>
async fn user_create( jwt: &Jwt, password: &str, user_create_opts: &UserCreateOpts, timeout: Option<Duration>, ) -> Result<UserCreateResult>
Source§async fn generate_new_device(
jwt: &Jwt,
password: &str,
device_create_options: &DeviceCreateOpts,
timeout: Option<Duration>,
) -> Result<DeviceAddResult>
async fn generate_new_device( jwt: &Jwt, password: &str, device_create_options: &DeviceCreateOpts, timeout: Option<Duration>, ) -> Result<DeviceAddResult>
Source§async fn user_verify(
jwt: &Jwt,
timeout: Option<Duration>,
) -> Result<Option<UserResult>>
async fn user_verify( jwt: &Jwt, timeout: Option<Duration>, ) -> Result<Option<UserResult>>
Source§async fn user_list_devices(&self) -> Result<UserDeviceListResult>
async fn user_list_devices(&self) -> Result<UserDeviceListResult>
Source§async fn user_get_public_key(
&self,
users: &[UserId],
) -> Result<HashMap<UserId, PublicKey>>
async fn user_get_public_key( &self, users: &[UserId], ) -> Result<HashMap<UserId, PublicKey>>
Source§async fn user_rotate_private_key(
&self,
password: &str,
) -> Result<UserUpdatePrivateKeyResult>
async fn user_rotate_private_key( &self, password: &str, ) -> Result<UserUpdatePrivateKeyResult>
Source§async fn user_delete_device(
&self,
device_id: Option<&DeviceId>,
) -> Result<DeviceId>
async fn user_delete_device( &self, device_id: Option<&DeviceId>, ) -> Result<DeviceId>
Source§async fn user_change_password(
&self,
current_password: &str,
new_password: &str,
) -> Result<UserUpdateResult>
async fn user_change_password( &self, current_password: &str, new_password: &str, ) -> Result<UserUpdateResult>
Auto Trait Implementations§
impl !Freeze for IronOxide
impl !RefUnwindSafe for IronOxide
impl Send for IronOxide
impl Sync for IronOxide
impl Unpin for IronOxide
impl !UnwindSafe for IronOxide
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
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>
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