CoreCryptoContext

The CoreCryptoContext holds the primary CoreCrypto APIs.

An instance of this struct is provided to the function handed to CoreCrypto::transaction.

Every mutable operation is done through this struct. This struct will buffer all operations in memory and when TransactionContext::finish is called, it will persist the data into the keystore.

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.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun addClientsToConversation(conversationId: ConversationId, keyPackages: List<KeyPackage>): List<String>?

See core_crypto::mls::conversation::ConversationGuard::add_members

Link copied to clipboard
open suspend override fun clientKeypackages(ciphersuite: Ciphersuite, credentialType: CredentialType, amountRequested: UInt): List<KeyPackage>

See core_crypto::transaction_context::TransactionContext::get_or_create_client_keypackages

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 suspend override fun clientValidKeypackagesCount(ciphersuite: Ciphersuite, credentialType: CredentialType): ULong

See core_crypto::transaction_context::TransactionContext::client_valid_key_packages_count

Link copied to clipboard
open override fun close()
Link copied to clipboard
open suspend override fun commitPendingProposals(conversationId: ConversationId)

See core_crypto::mls::conversation::ConversationGuard::commit_pending_proposals

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 createConversation(conversationId: ConversationId, creatorCredentialType: CredentialType, config: ConversationConfiguration)

See core_crypto::transaction_context::TransactionContext::new_conversation

Link copied to clipboard
open suspend override fun decryptMessage(conversationId: ConversationId, payload: ByteArray): DecryptedMessage

See core_crypto::mls::conversation::ConversationGuard::decrypt_message

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

See core_crypto::transaction_context::TransactionContext::delete_stale_key_packages

Link copied to clipboard
open override fun destroy()
Link copied to clipboard
open suspend override fun disableHistorySharing(conversationId: ConversationId)

See core_crypto::mls::conversation::ConversationGuard::disable_history_sharing

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 e2eiEnrollmentStash(enrollment: E2eiEnrollment): ByteArray

See core_crypto::transaction_context::TransactionContext::e2ei_enrollment_stash

Link copied to clipboard
open suspend override fun e2eiEnrollmentStashPop(handle: ByteArray): E2eiEnrollment

See core_crypto::transaction_context::TransactionContext::e2ei_enrollment_stash_pop

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 e2eiMlsInitOnly(enrollment: E2eiEnrollment, certificateChain: String, nbKeyPackage: UInt?): List<String>?

See core_crypto::transaction_context::TransactionContext::e2ei_mls_init_only

Link copied to clipboard
open suspend override fun e2eiNewActivationEnrollment(displayName: String, handle: String, team: String?, expirySec: UInt, ciphersuite: Ciphersuite): E2eiEnrollment

See core_crypto::transaction_context::TransactionContext::e2ei_new_activation_enrollment

Link copied to clipboard
open suspend override fun e2eiNewEnrollment(clientId: String, displayName: String, handle: String, team: String?, expirySec: UInt, ciphersuite: Ciphersuite): E2eiEnrollment

See core_crypto::transaction_context::TransactionContext::e2ei_new_enrollment

Link copied to clipboard
open suspend override fun e2eiNewRotateEnrollment(displayName: String?, handle: String?, team: String?, expirySec: UInt, ciphersuite: Ciphersuite): E2eiEnrollment

See core_crypto::transaction_context::TransactionContext::e2ei_new_rotate_enrollment

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

See core_crypto::transaction_context::TransactionContext::e2ei_register_acme_ca

Link copied to clipboard
open suspend override fun e2eiRegisterCrl(crlDp: String, crlDer: ByteArray): CrlRegistration

See core_crypto::transaction_context::TransactionContext::e2ei_register_crl

Link copied to clipboard
open suspend override fun e2eiRegisterIntermediateCa(certPem: String): List<String>?

See core_crypto::transaction_context::TransactionContext::e2ei_register_intermediate_ca_pem

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

See core_crypto::mls::conversation::ConversationGuard::e2ei_rotate

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

See core_crypto::mls::conversation::ConversationGuard::enable_history_sharing

Link copied to clipboard
open suspend override fun encryptMessage(conversationId: ConversationId, message: ByteArray): ByteArray

See core_crypto::mls::conversation::ConversationGuard::encrypt_message

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

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 getData(): ByteArray?

See core_crypto::transaction_context::TransactionContext::get_data

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): ExternalSenderKey

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 joinByExternalCommit(groupInfo: GroupInfo, customConfiguration: CustomConfiguration, credentialType: CredentialType): WelcomeBundle

See core_crypto::transaction_context::TransactionContext::join_by_external_commit

Link copied to clipboard
open suspend override fun markConversationAsChildOf(childId: ConversationId, parentId: ConversationId)

See core_crypto::mls::conversation::ConversationGuard::mark_as_child_of

Link copied to clipboard
open suspend override fun mlsInit(clientId: ClientId, ciphersuites: List<Ciphersuite>, nbKeyPackage: UInt?)

See core_crypto::transaction_context::TransactionContext::mls_init

Link copied to clipboard
open suspend override fun processWelcomeMessage(welcomeMessage: Welcome, customConfiguration: CustomConfiguration): WelcomeBundle

See core_crypto::transaction_context::TransactionContext::process_raw_welcome_message

Link copied to clipboard
open suspend override fun proteusDecrypt(sessionId: String, ciphertext: ByteArray): ByteArray

See core_crypto::transaction_context::TransactionContext::proteus_decrypt

Link copied to clipboard
open suspend override fun proteusDecryptSafe(sessionId: String, ciphertext: ByteArray): ByteArray

Decrypt a message whether or not the proteus session already exists, and saves the session.

Link copied to clipboard
open suspend override fun proteusEncrypt(sessionId: String, plaintext: ByteArray): ByteArray

See core_crypto::transaction_context::TransactionContext::proteus_encrypt

Link copied to clipboard
open suspend override fun proteusEncryptBatched(sessions: List<String>, plaintext: ByteArray): Map<String, ByteArray>

See core_crypto::transaction_context::TransactionContext::proteus_encrypt_batched

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

See core_crypto::transaction_context::TransactionContext::proteus_fingerprint

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

See core_crypto::transaction_context::TransactionContext::proteus_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::transaction_context::TransactionContext::proteus_fingerprint_remote

Link copied to clipboard
open suspend override fun proteusInit()

See core_crypto::proteus::ProteusCentral::try_new

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

See core_crypto::transaction_context::TransactionContext::proteus_last_resort_prekey

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 proteusNewPrekey(prekeyId: UShort): ByteArray

Creates a new Proteus prekey with the given id and returns the CBOR-serialized version of the prekey bundle

Link copied to clipboard
open suspend override fun proteusNewPrekeyAuto(): ProteusAutoPrekeyBundle

Creates a new Proteus prekey with an automatically incremented ID and returns the CBOR-serialized version of the prekey bundle

Link copied to clipboard
open suspend override fun proteusReloadSessions()

See core_crypto::transaction_context::TransactionContext::proteus_reload_sessions

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

See core_crypto::transaction_context::TransactionContext::proteus_session_delete

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

See core_crypto::transaction_context::TransactionContext::proteus_session_exists

Link copied to clipboard
open suspend override fun proteusSessionFromMessage(sessionId: String, envelope: ByteArray): ByteArray

See core_crypto::transaction_context::TransactionContext::proteus_session_from_message

Link copied to clipboard
open suspend override fun proteusSessionFromPrekey(sessionId: String, prekey: ByteArray)

See core_crypto::transaction_context::TransactionContext::proteus_session_from_prekey

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

See core_crypto::transaction_context::TransactionContext::proteus_session_save

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

See core_crypto::prelude::Session::random_bytes.

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

See core_crypto::mls::conversation::ConversationGuard::remove_members

Link copied to clipboard
open suspend override fun saveX509Credential(enrollment: E2eiEnrollment, certificateChain: String): List<String>?

See core_crypto::transaction_context::TransactionContext::save_x509_credential

Link copied to clipboard
open suspend override fun setData(data: ByteArray)

See core_crypto::transaction_context::TransactionContext::set_data

Link copied to clipboard
fun uniffiClonePointer(): Pointer
Link copied to clipboard
open suspend override fun updateKeyingMaterial(conversationId: ConversationId)

See core_crypto::mls::conversation::ConversationGuard::update_key_material

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

See core_crypto::mls::conversation::ConversationGuard::wipe