CoreCryptoFfi

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

Constructors

Link copied to clipboard
constructor(pointer: Pointer)
constructor(noPointer: NoPointer)

This constructor can be used to instantiate a fake object. Only used for tests. Any attempt to actually use an object constructed this way will fail as there is no connected Rust object.

constructor(database: Database)

Construct a new CoreCryptoFfi instance. MLS or proteus can be initialized with core_crypto::transaction_context::TransactionContext::mls_init or core_crypto::transaction_context::TransactionContext::proteus_init, respectively.

Types

Link copied to clipboard
object Companion

Functions

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 conversationCredential(conversationId: ConversationId): CredentialRef

Get the credential ref for the given conversation.

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 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::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 getPkiEnvironment(): PkiEnvironment?

Get the PKI environment of the CoreCrypto instance Returns null if it is not set.

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 suspend override fun proteusFingerprintRemote(sessionId: String): String

See core_crypto::proteus::ProteusCentral::fingerprint_remote

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 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 setPkiEnvironment(pkiEnvironment: PkiEnvironment?)

Set the Pki Environment of the CoreCrypto instance

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.

Link copied to clipboard
fun uniffiClonePointer(): Pointer