CoreCryptoClient

A high-level wrapper around a CoreCrypto client as emitted by Uniffi.

This wrapper should be largely transparent to end users. It exists to improve the callback interfaces: .transaction(...), .registerFooObserver(...), etc.

Constructors

Link copied to clipboard
constructor(cc: CoreCrypto)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun clientPublicKey(ciphersuite: Ciphersuite, credentialType: CredentialType): ByteArray

See core_crypto::transaction_context::TransactionContext::client_public_key

Link copied to clipboard
fun close()

Closes this CoreCrypto instance and deallocates all loaded resources.

Link copied to clipboard
open suspend override fun conversationCiphersuite(conversationId: ConversationId): Ciphersuite

See core_crypto::mls::conversation::Conversation::ciphersuite

Link copied to clipboard
open suspend override fun conversationEpoch(conversationId: ConversationId): ULong

See core_crypto::mls::conversation::Conversation::epoch

Link copied to clipboard
open suspend override fun conversationExists(conversationId: ConversationId): Boolean

See core_crypto::prelude::Session::conversation_exists

Link copied to clipboard
open suspend override fun e2eiConversationState(conversationId: ConversationId): E2eiConversationState

See core_crypto::mls::conversation::Conversation::e2ei_conversation_state

Link copied to clipboard
open suspend override fun e2eiIsEnabled(ciphersuite: Ciphersuite): Boolean

See core_crypto::prelude::Session::e2ei_is_enabled

Link copied to clipboard
open suspend override fun e2eiIsPkiEnvSetup(): Boolean

See core_crypto::prelude::Session::e2ei_is_pki_env_setup

Link copied to clipboard
open suspend override fun exportSecretKey(conversationId: ConversationId, keyLength: UInt): ByteArray

See core_crypto::mls::conversation::Conversation::export_secret_key

Link copied to clipboard
open suspend override fun getClientIds(conversationId: ConversationId): List<ClientId>

See core_crypto::mls::conversation::Conversation::get_client_ids

Link copied to clipboard
open suspend override fun getDeviceIdentities(conversationId: ConversationId, deviceIds: List<ClientId>): List<WireIdentity>

See core_crypto::mls::conversation::Conversation::get_device_identities

Link copied to clipboard
open suspend override fun getExternalSender(conversationId: ConversationId): ByteArray

See core_crypto::mls::conversation::Conversation::get_external_sender

Link copied to clipboard
open suspend override fun getUserIdentities(conversationId: ConversationId, userIds: List<String>): Map<String, List<WireIdentity>>

See core_crypto::mls::conversation::Conversation::get_user_identities

Link copied to clipboard
open suspend override fun isHistorySharingEnabled(conversationId: ConversationId): Boolean

See core_crypto::mls::conversation::Conversation::is_history_sharing_enabled

Link copied to clipboard
open suspend override fun proteusFingerprint(): String

See core_crypto::proteus::ProteusCentral::fingerprint

Link copied to clipboard
open suspend override fun proteusFingerprintLocal(sessionId: String): String

See core_crypto::proteus::ProteusCentral::fingerprint_local

Link copied to clipboard
open override fun proteusFingerprintPrekeybundle(prekey: ByteArray): String

See core_crypto::proteus::ProteusCentral::fingerprint_prekeybundle

Link copied to clipboard
open suspend override fun proteusFingerprintRemote(sessionId: String): String

See core_crypto::proteus::ProteusCentral::fingerprint_remote

Link copied to clipboard
open override fun proteusLastResortPrekeyId(): UShort

See core_crypto::proteus::ProteusCentral::last_resort_prekey_id

Link copied to clipboard
open suspend override fun proteusSessionExists(sessionId: String): Boolean

See core_crypto::proteus::ProteusCentral::session_exists

Link copied to clipboard
open suspend override fun provideTransport(callbacks: MlsTransport)

See core_crypto::prelude::Session::provide_transport

Link copied to clipboard
open suspend override fun randomBytes(len: UInt): ByteArray

See core_crypto::prelude::Session::random_bytes

Link copied to clipboard
suspend fun registerEpochObserver(scope: CoroutineScope, epochObserver: EpochObserver)

Register an Epoch Observer which will be notified every time a conversation's epoch changes.

open suspend override fun registerEpochObserver(epochObserver: EpochObserver)

Add an epoch observer to this client.

Link copied to clipboard
suspend fun registerHistoryObserver(scope: CoroutineScope, historyObserver: HistoryObserver)

Register a History Observer which will be notified every time a new history client is created.

open suspend override fun registerHistoryObserver(historyObserver: HistoryObserver)

Add a history observer to this client.

Link copied to clipboard
open suspend override fun reseedRng(seed: ByteArray)

see core_crypto::prelude::Session::reseed

Link copied to clipboard
suspend fun <R> transaction(block: suspend (context: CoreCryptoContext) -> R): R

Starts a NonCancellable transaction in Core Crypto. If the callback succeeds, it will be committed, otherwise, every operation performed with the context will be discarded.

open suspend override fun transaction(command: CoreCryptoCommand)

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.