Struct ironoxide::IronOxide

source ·
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

source

pub fn device(&self) -> &DeviceContext

DeviceContext that was used to create this SDK instance

source

pub fn clear_policy_cache(&self) -> usize

Clears all entries from the policy cache.

Returns the number of entries cleared from the cache.

source

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 rotated
  • password - Password to unlock the current user’s user master key
  • timeout - 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

source§

async fn create_blind_index( &self, group_id: &GroupId, ) -> Result<EncryptedBlindIndexSalt>

Create an index and encrypt it to the provided group_id.
source§

impl Debug for IronOxide

Manual implementation of Debug without the recrypt or rng fields

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl DocumentAdvancedOps for IronOxide

source§

async fn document_encrypt_unmanaged( &self, data: Vec<u8>, encrypt_opts: &DocumentEncryptOpts, ) -> Result<DocumentEncryptUnmanagedResult>

Encrypts the provided document bytes without being managed by the IronCore service. Read more
source§

async fn document_decrypt_unmanaged( &self, encrypted_data: &[u8], encrypted_deks: &[u8], ) -> Result<DocumentDecryptUnmanagedResult>

Decrypts a document not managed by the IronCore service. Read more
source§

impl DocumentOps for IronOxide

source§

async fn document_encrypt( &self, document_data: Vec<u8>, encrypt_opts: &DocumentEncryptOpts, ) -> Result<DocumentEncryptResult>

Encrypts the provided document bytes. Read more
source§

async fn document_decrypt( &self, encrypted_document: &[u8], ) -> Result<DocumentDecryptResult>

Decrypts an IronCore encrypted document. Read more
source§

async fn document_list(&self) -> Result<DocumentListResult>

Lists metadata for all of the encrypted documents that the calling user can read or decrypt. Read more
source§

async fn document_get_metadata( &self, id: &DocumentId, ) -> Result<DocumentMetadataResult>

Returns the metadata for an encrypted document. Read more
source§

fn document_get_id_from_bytes( &self, encrypted_document: &[u8], ) -> Result<DocumentId>

Returns the document ID from the bytes of an encrypted document. Read more
source§

async fn document_update_bytes( &self, id: &DocumentId, new_document_data: Vec<u8>, ) -> Result<DocumentEncryptResult>

Updates the contents of an existing IronCore encrypted document. Read more
source§

async fn document_update_name( &self, id: &DocumentId, name: Option<&DocumentName>, ) -> Result<DocumentMetadataResult>

Modifies or removes a document’s name. Read more
source§

async fn document_grant_access( &self, id: &DocumentId, grant_list: &[UserOrGroup], ) -> Result<DocumentAccessResult>

Grants decryption access to a document for the provided users and/or groups. Read more
source§

async fn document_revoke_access( &self, id: &DocumentId, revoke_list: &[UserOrGroup], ) -> Result<DocumentAccessResult>

Revokes decryption access to a document for the provided users and/or groups. Read more
source§

impl GroupOps for IronOxide

source§

async fn group_create( &self, opts: &GroupCreateOpts, ) -> Result<GroupCreateResult>

Creates a group. Read more
source§

async fn group_get_metadata(&self, id: &GroupId) -> Result<GroupGetResult>

Gets the full metadata for a group. Read more
source§

async fn group_list(&self) -> Result<GroupListResult>

Lists all of the groups that the current user is an admin or a member of. Read more
source§

async fn group_update_name( &self, id: &GroupId, name: Option<&GroupName>, ) -> Result<GroupMetaResult>

Modifies or removes a group’s name. Read more
source§

async fn group_rotate_private_key( &self, id: &GroupId, ) -> Result<GroupUpdatePrivateKeyResult>

Rotates a group’s private key while leaving its public key unchanged. Read more
source§

async fn group_add_members( &self, id: &GroupId, grant_list: &[UserId], ) -> Result<GroupAccessEditResult>

Adds members to a group. Read more
source§

async fn group_remove_members( &self, id: &GroupId, revoke_list: &[UserId], ) -> Result<GroupAccessEditResult>

Removes members from a group. Read more
source§

async fn group_add_admins( &self, id: &GroupId, users: &[UserId], ) -> Result<GroupAccessEditResult>

Adds administrators to a group. Read more
source§

async fn group_remove_admins( &self, id: &GroupId, revoke_list: &[UserId], ) -> Result<GroupAccessEditResult>

Removes administrators from a group. Read more
source§

async fn group_delete(&self, id: &GroupId) -> Result<GroupId>

Deletes a group. Read more
source§

impl UserOps for IronOxide

source§

async fn user_create( jwt: &Jwt, password: &str, user_create_opts: &UserCreateOpts, timeout: Option<Duration>, ) -> Result<UserCreateResult>

Creates a user. Read more
source§

async fn generate_new_device( jwt: &Jwt, password: &str, device_create_options: &DeviceCreateOpts, timeout: Option<Duration>, ) -> Result<DeviceAddResult>

Generates a new device for the user specified in the JWT. Read more
source§

async fn user_verify( jwt: &Jwt, timeout: Option<Duration>, ) -> Result<Option<UserResult>>

Verifies the existence of a user using a JWT to identify their user record. Read more
source§

async fn user_list_devices(&self) -> Result<UserDeviceListResult>

Lists all of the devices for the current user. Read more
source§

async fn user_get_public_key( &self, users: &[UserId], ) -> Result<HashMap<UserId, PublicKey>>

Gets users’ public keys given their IDs. Read more
source§

async fn user_rotate_private_key( &self, password: &str, ) -> Result<UserUpdatePrivateKeyResult>

Rotates the current user’s private key while leaving their public key the same. Read more
source§

async fn user_delete_device( &self, device_id: Option<&DeviceId>, ) -> Result<DeviceId>

Deletes a device. Read more
source§

async fn user_change_password( &self, current_password: &str, new_password: &str, ) -> Result<UserUpdateResult>

Change the password for the user Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more