CoreCryptoFfi

CoreCrypto wraps around MLS and Proteus implementations and provides a transactional interface for each.

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
open override fun close()
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::Session::conversation_exists

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

See core_crypto::Session::e2ei_is_enabled

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

See core_crypto::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

Wrap a CoreCrypto instance in a CoreCryptoClient instance. Should largely be invisible to end-users.

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::Session::provide_transport

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

See core_crypto::Session::random_bytes

Link copied to clipboard
open suspend override fun registerEpochObserver(epochObserver: EpochObserver)

Add an epoch observer to this client.

Link copied to clipboard
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::Session::reseed

Link copied to clipboard
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.