pub struct CoreCrypto { /* private fields */ }
Implementations§
Source§impl CoreCrypto
impl CoreCrypto
Sourcepub async fn transaction(
&self,
command: Arc<dyn CoreCryptoCommand>,
) -> Result<(), CoreCryptoError>
pub async fn transaction( &self, command: Arc<dyn CoreCryptoCommand>, ) -> Result<(), CoreCryptoError>
Starts a new transaction in Core Crypto. If the callback succeeds, it will be committed, otherwise, every operation performed with the context will be discarded.
When calling this function from within Rust, async functions accepting a context
implement CoreCryptoCommand
, so operations can be defined inline as follows:
core_crypto.transaction(Arc::new(|context| async {
// your implementation here
Ok(())
}))?;
Source§impl CoreCrypto
impl CoreCrypto
Sourcepub async fn register_epoch_observer(
&self,
epoch_observer: Arc<dyn EpochObserver>,
) -> Result<(), CoreCryptoError>
pub async fn register_epoch_observer( &self, epoch_observer: Arc<dyn EpochObserver>, ) -> Result<(), CoreCryptoError>
Add an epoch observer to this client.
This function should be called 0 or 1 times in a client’s lifetime. If called when an epoch observer already exists, this will return an error.
Source§impl CoreCrypto
impl CoreCrypto
pub async fn new( path: String, key: String, client_id: Option<ClientId>, ciphersuites: Option<Ciphersuites>, nb_key_package: Option<u32>, ) -> Result<Self, CoreCryptoError>
Sourcepub async fn provide_transport(
&self,
callbacks: Arc<dyn MlsTransport>,
) -> Result<(), CoreCryptoError>
pub async fn provide_transport( &self, callbacks: Arc<dyn MlsTransport>, ) -> Result<(), CoreCryptoError>
Sourcepub async fn client_public_key(
&self,
ciphersuite: Ciphersuite,
credential_type: MlsCredentialType,
) -> Result<Vec<u8>, CoreCryptoError>
pub async fn client_public_key( &self, ciphersuite: Ciphersuite, credential_type: MlsCredentialType, ) -> Result<Vec<u8>, CoreCryptoError>
Sourcepub async fn conversation_epoch(
&self,
conversation_id: Vec<u8>,
) -> Result<u64, CoreCryptoError>
pub async fn conversation_epoch( &self, conversation_id: Vec<u8>, ) -> Result<u64, CoreCryptoError>
See [core_crypto::mls::conversation::ImmutableConversation::epoch]
Sourcepub async fn conversation_ciphersuite(
&self,
conversation_id: &ConversationId,
) -> Result<Ciphersuite, CoreCryptoError>
pub async fn conversation_ciphersuite( &self, conversation_id: &ConversationId, ) -> Result<Ciphersuite, CoreCryptoError>
See [core_crypto::mls::conversation::ImmutableConversation::ciphersuite]
Sourcepub async fn conversation_exists(
&self,
conversation_id: Vec<u8>,
) -> Result<bool, CoreCryptoError>
pub async fn conversation_exists( &self, conversation_id: Vec<u8>, ) -> Result<bool, CoreCryptoError>
Sourcepub async fn random_bytes(&self, len: u32) -> Result<Vec<u8>, CoreCryptoError>
pub async fn random_bytes(&self, len: u32) -> Result<Vec<u8>, CoreCryptoError>
Sourcepub async fn reseed_rng(&self, seed: Vec<u8>) -> Result<(), CoreCryptoError>
pub async fn reseed_rng(&self, seed: Vec<u8>) -> Result<(), CoreCryptoError>
Sourcepub async fn get_client_ids(
&self,
conversation_id: Vec<u8>,
) -> Result<Vec<ClientId>, CoreCryptoError>
pub async fn get_client_ids( &self, conversation_id: Vec<u8>, ) -> Result<Vec<ClientId>, CoreCryptoError>
See [core_crypto::mls::conversation::ImmutableConversation::get_client_ids]
Sourcepub async fn export_secret_key(
&self,
conversation_id: Vec<u8>,
key_length: u32,
) -> Result<Vec<u8>, CoreCryptoError>
pub async fn export_secret_key( &self, conversation_id: Vec<u8>, key_length: u32, ) -> Result<Vec<u8>, CoreCryptoError>
See [core_crypto::mls::conversation::ImmutableConversation::export_secret_key]
Sourcepub async fn get_external_sender(
&self,
conversation_id: Vec<u8>,
) -> Result<Vec<u8>, CoreCryptoError>
pub async fn get_external_sender( &self, conversation_id: Vec<u8>, ) -> Result<Vec<u8>, CoreCryptoError>
See [core_crypto::mls::conversation::ImmutableConversation::get_external_sender]
Source§impl CoreCrypto
impl CoreCrypto
Sourcepub async fn proteus_session_exists(
&self,
session_id: String,
) -> Result<bool, CoreCryptoError>
pub async fn proteus_session_exists( &self, session_id: String, ) -> Result<bool, CoreCryptoError>
Sourcepub fn proteus_last_resort_prekey_id(&self) -> Result<u16, CoreCryptoError>
pub fn proteus_last_resort_prekey_id(&self) -> Result<u16, CoreCryptoError>
Sourcepub async fn proteus_fingerprint(&self) -> Result<String, CoreCryptoError>
pub async fn proteus_fingerprint(&self) -> Result<String, CoreCryptoError>
Sourcepub async fn proteus_fingerprint_local(
&self,
session_id: String,
) -> Result<String, CoreCryptoError>
pub async fn proteus_fingerprint_local( &self, session_id: String, ) -> Result<String, CoreCryptoError>
Sourcepub async fn proteus_fingerprint_remote(
&self,
session_id: String,
) -> Result<String, CoreCryptoError>
pub async fn proteus_fingerprint_remote( &self, session_id: String, ) -> Result<String, CoreCryptoError>
Sourcepub fn proteus_fingerprint_prekeybundle(
&self,
prekey: Vec<u8>,
) -> Result<String, CoreCryptoError>
pub fn proteus_fingerprint_prekeybundle( &self, prekey: Vec<u8>, ) -> Result<String, CoreCryptoError>
See core_crypto::proteus::ProteusCentral::fingerprint_prekeybundle NOTE: uniffi doesn’t support associated functions, so we have to have the self here
Source§impl CoreCrypto
impl CoreCrypto
pub async fn e2ei_dump_pki_env( &self, ) -> Result<Option<E2eiDumpedPkiEnv>, CoreCryptoError>
Sourcepub async fn e2ei_is_pki_env_setup(&self) -> bool
pub async fn e2ei_is_pki_env_setup(&self) -> bool
Sourcepub async fn e2ei_is_enabled(
&self,
ciphersuite: Ciphersuite,
) -> Result<bool, CoreCryptoError>
pub async fn e2ei_is_enabled( &self, ciphersuite: Ciphersuite, ) -> Result<bool, CoreCryptoError>
Sourcepub async fn get_device_identities(
&self,
conversation_id: Vec<u8>,
device_ids: Vec<ClientId>,
) -> Result<Vec<WireIdentity>, CoreCryptoError>
pub async fn get_device_identities( &self, conversation_id: Vec<u8>, device_ids: Vec<ClientId>, ) -> Result<Vec<WireIdentity>, CoreCryptoError>
See [core_crypto::mls::conversation::ConversationGuard::get_device_identities]
Sourcepub async fn get_user_identities(
&self,
conversation_id: Vec<u8>,
user_ids: Vec<String>,
) -> Result<HashMap<String, Vec<WireIdentity>>, CoreCryptoError>
pub async fn get_user_identities( &self, conversation_id: Vec<u8>, user_ids: Vec<String>, ) -> Result<HashMap<String, Vec<WireIdentity>>, CoreCryptoError>
See [core_crypto::mls::conversation::ConversationGuard::get_user_identities]
Sourcepub async fn get_credential_in_use(
&self,
group_info: Vec<u8>,
credential_type: MlsCredentialType,
) -> Result<E2eiConversationState, CoreCryptoError>
pub async fn get_credential_in_use( &self, group_info: Vec<u8>, credential_type: MlsCredentialType, ) -> Result<E2eiConversationState, CoreCryptoError>
Trait Implementations§
Source§impl Debug for CoreCrypto
impl Debug for CoreCrypto
Source§impl<UT> LiftRef<UT> for CoreCrypto
impl<UT> LiftRef<UT> for CoreCrypto
type LiftType = Arc<CoreCrypto>
Source§impl<UT> LowerError<UT> for CoreCrypto
impl<UT> LowerError<UT> for CoreCrypto
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for CoreCrypto
impl<UT> LowerReturn<UT> for CoreCrypto
Source§type ReturnType = <Arc<CoreCrypto> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<CoreCrypto> 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 CoreCrypto
impl<UT> TypeId<UT> for CoreCrypto
const TYPE_ID_META: MetadataBuffer
Auto Trait Implementations§
impl Freeze for CoreCrypto
impl !RefUnwindSafe for CoreCrypto
impl Send for CoreCrypto
impl Sync for CoreCrypto
impl Unpin for CoreCrypto
impl !UnwindSafe for CoreCrypto
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
§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 moreSource§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