CoreCryptoFfiInterface

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

Inheritors

Types

Link copied to clipboard
object Companion

Functions

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

Returns the ciphersuite in use for the given conversation.

Link copied to clipboard
abstract suspend fun conversationCredential(conversationId: ConversationId): CredentialRef

Get the credential ref for the given conversation.

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

Returns the current MLS epoch of the given conversation.

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

Returns true if a conversation with the given id exists in the local state.

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

Returns the end-to-end identity verification state of the given conversation.

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

Returns true if end-to-end identity is enabled for the given ciphersuite.

Link copied to clipboard
abstract suspend fun e2eiIsPkiEnvSetup(): Boolean

Returns true if the PKI environment has been set up and its provider is configured.

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

Derives and exports a secret of key_length bytes for the given conversation.

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

Returns the client ids of all members of the given conversation.

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

Returns the E2EI identity claims for the specified devices in the given conversation.

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

Returns the serialized public key of the external sender for the given conversation.

Link copied to clipboard
abstract suspend fun getPkiEnvironment(): PkiEnvironment?

Get the PKI environment of the CoreCrypto instance.

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

Returns the E2EI identity claims for the specified users in the given conversation, grouped by user ID.

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

Returns true if history sharing is currently enabled for the given conversation.

Link copied to clipboard
abstract suspend fun proteusFingerprint(): String

Returns the hex-encoded public key fingerprint of this device's Proteus identity.

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

Returns the hex-encoded local public key fingerprint for the Proteus session with the given ID.

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

Returns the hex-encoded remote public key fingerprint for the Proteus session with the given ID.

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

Returns true if a Proteus session with the given ID exists in local storage.

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

Add an epoch observer to this client.

Link copied to clipboard
abstract suspend fun registerHistoryObserver(historyObserver: HistoryObserver)

Add a history observer to this client.

Link copied to clipboard
abstract suspend fun setPkiEnvironment(pkiEnvironment: PkiEnvironment?)

Set the PKI environment of the CoreCrypto instance.

Link copied to clipboard
abstract suspend fun transactionFfi(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.