CoreCryptoProtocol

public protocol CoreCryptoProtocol : AnyObject, Sendable

Undocumented

  • canClose() Asynchronous

    See [Session::can_close]

    Declaration

    Swift

    func canClose() async -> Bool
  • See [core_crypto::transaction_context::TransactionContext::client_public_key]

    Declaration

    Swift

    func clientPublicKey(ciphersuite: Ciphersuite, credentialType: CredentialType) async throws -> Data
  • See [core_crypto::mls::conversation::Conversation::ciphersuite]

    Declaration

    Swift

    func conversationCiphersuite(conversationId: ConversationId) async throws -> Ciphersuite
  • See [core_crypto::mls::conversation::Conversation::epoch]

    Declaration

    Swift

    func conversationEpoch(conversationId: ConversationId) async throws -> UInt64
  • See [core_crypto::prelude::Session::conversation_exists]

    Declaration

    Swift

    func conversationExists(conversationId: ConversationId) async throws -> Bool
  • See [core_crypto::prelude::Session::e2ei_is_enabled]

    Declaration

    Swift

    func e2eiIsEnabled(ciphersuite: Ciphersuite) async throws -> Bool
  • e2eiIsPkiEnvSetup() Asynchronous

    See [core_crypto::prelude::Session::e2ei_is_pki_env_setup]

    Declaration

    Swift

    func e2eiIsPkiEnvSetup() async -> Bool
  • See [core_crypto::mls::conversation::Conversation::export_secret_key]

    Declaration

    Swift

    func exportSecretKey(conversationId: ConversationId, keyLength: UInt32) async throws -> Data
  • See [core_crypto::mls::conversation::Conversation::get_client_ids]

    Declaration

    Swift

    func getClientIds(conversationId: ConversationId) async throws -> [ClientId]
  • See [core_crypto::mls::conversation::Conversation::get_device_identities]

    Declaration

    Swift

    func getDeviceIdentities(conversationId: ConversationId, deviceIds: [ClientId]) async throws -> [WireIdentity]
  • See [core_crypto::mls::conversation::Conversation::get_external_sender]

    Declaration

    Swift

    func getExternalSender(conversationId: ConversationId) async throws -> Data
  • See [core_crypto::mls::conversation::Conversation::get_user_identities]

    Declaration

    Swift

    func getUserIdentities(conversationId: ConversationId, userIds: [String]) async throws -> [String : [WireIdentity]]
  • See [core_crypto::mls::conversation::Conversation::is_history_sharing_enabled]

    Declaration

    Swift

    func isHistorySharingEnabled(conversationId: ConversationId) async throws -> Bool
  • proteusFingerprint() Asynchronous

    See [core_crypto::proteus::ProteusCentral::fingerprint]

    Declaration

    Swift

    func proteusFingerprint() async throws -> String
  • See [core_crypto::proteus::ProteusCentral::fingerprint_local]

    Declaration

    Swift

    func proteusFingerprintLocal(sessionId: String) async throws -> String
  • See [core_crypto::proteus::ProteusCentral::fingerprint_prekeybundle]

    Declaration

    Swift

    func proteusFingerprintPrekeybundle(prekey: Data) throws -> String
  • See [core_crypto::proteus::ProteusCentral::fingerprint_remote]

    Declaration

    Swift

    func proteusFingerprintRemote(sessionId: String) async throws -> String
  • See [core_crypto::proteus::ProteusCentral::last_resort_prekey_id]

    Declaration

    Swift

    func proteusLastResortPrekeyId() throws -> UInt16
  • See [core_crypto::proteus::ProteusCentral::session_exists]

    Declaration

    Swift

    func proteusSessionExists(sessionId: String) async throws -> Bool
  • See [core_crypto::prelude::Session::provide_transport]

    Declaration

    Swift

    func provideTransport(callbacks: MlsTransport) async throws
  • randomBytes(len:) Asynchronous

    See [core_crypto::prelude::Session::random_bytes]

    Declaration

    Swift

    func randomBytes(len: UInt32) async throws -> Data
  • Add an epoch observer to this client.

    This function should be called 0 or 1 times in a session’s lifetime. If called when an epoch observer already exists, this will return an error.

    Declaration

    Swift

    func registerEpochObserver(epochObserver: EpochObserver) async throws
  • Add a history observer to this client.

    This function should be called 0 or 1 times in a session’s lifetime. If called when an history observer already exists, this will return an error.

    Declaration

    Swift

    func registerHistoryObserver(historyObserver: HistoryObserver) async throws
  • reseedRng(seed:) Asynchronous

    see [core_crypto::prelude::Session::reseed]

    Declaration

    Swift

    func reseedRng(seed: Data) async throws
  • transaction(command:) Asynchronous

    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.

    When calling this function from within Rust, async functions accepting a context implement CoreCryptoCommand, so operations can be defined inline as follows:

     core_crypto.transaction(Arc::new(async |context| {
     // your implementation here
     Ok(())
     }))?;
    

    Declaration

    Swift

    func transaction(command: CoreCryptoCommand) async throws