Functions

The following functions are available globally.

  • Undocumented

    Declaration

    Swift

    public func uniffiForeignFutureHandleCountCoreCryptoFfi() -> Int
  • buildMetadata() From WireCoreCryptoUniffi

    Returns build data for CoreCrypto

    Declaration

    Swift

    public func buildMetadata() -> BuildMetadata
  • ciphersuiteDefault() From WireCoreCryptoUniffi

    Get an instance of the default ciphersuite.

    Declaration

    Swift

    public func ciphersuiteDefault() -> Ciphersuite
  • ciphersuiteFromU16(discriminant:) From WireCoreCryptoUniffi

    Construct a ciphersuite enum instance from its discriminant.

    Declaration

    Swift

    public func ciphersuiteFromU16(discriminant: UInt16) throws -> Ciphersuite
  • coreCryptoDeferredInit(path:key:entropySeed:) Asynchronous, from WireCoreCryptoUniffi

    Free function to construct a new CoreCrypto instance.

    Similar to [core_crypto_new] but defers MLS initialization. It can be initialized later with [core_crypto::transaction_context::TransactionContext::mls_init].

    Declaration

    Swift

    public func coreCryptoDeferredInit(path: String, key: DatabaseKey, entropySeed: Data?) async throws -> CoreCrypto
  • coreCryptoHistoryClient(historySecret:) Asynchronous, from WireCoreCryptoUniffi

    Instantiate a history client.

    This client exposes the full interface of CoreCrypto, but it should only be used to decrypt messages. Other use is a logic error.

    Declaration

    Swift

    public func coreCryptoHistoryClient(historySecret: HistorySecret) async throws -> CoreCrypto
  • Free function to construct a new CoreCrypto instance.

    This is necessary because in uniffi async constructors are not supported.

    See [Session::try_new]

    Declaration

    Swift

    public func coreCryptoNew(path: String, key: DatabaseKey, clientId: ClientId, ciphersuites: [Ciphersuite], entropySeed: Data?, nbKeyPackage: UInt32?) async throws -> CoreCrypto
  • exportDatabaseCopy(database:destinationPath:) Asynchronous, from WireCoreCryptoUniffi

    Export a copy of the database to the specified path.

    This creates a fully vacuumed and optimized copy of the database using SQLite’s VACUUM INTO command. The copy will be encrypted with the same key as the source database.

    # Platform Support This method is only useful on platforms using SQLCipher (iOS, Android, JVM, native). On WASM platforms, this function will return an error.

    # Arguments

    • database - The database instance to export
    • destination_path - The file path where the database copy should be created

    Declaration

    Swift

    public func exportDatabaseCopy(database: Database, destinationPath: String) async throws
  • migrateDatabaseKeyTypeToBytes(path:oldKey:newKey:) Asynchronous, from WireCoreCryptoUniffi

    Updates the key of the CoreCrypto database. To be used only once, when moving from CoreCrypto <= 5.x to CoreCrypto 6.x.

    Declaration

    Swift

    public func migrateDatabaseKeyTypeToBytes(path: String, oldKey: String, newKey: DatabaseKey) async throws
  • openDatabase(name:key:) Asynchronous, from WireCoreCryptoUniffi

    Open or create a [Database].

    Declaration

    Swift

    public func openDatabase(name: String, key: DatabaseKey) async throws -> Database
  • setLogger(logger:level:) From WireCoreCryptoUniffi

    Initializes the logger

    NOTE: in a future release we will remove level argument.

    Declaration

    Swift

    public func setLogger(logger: CoreCryptoLogger, level: CoreCryptoLogLevel)
  • setLoggerOnly(logger:) From WireCoreCryptoUniffi

    Initializes the logger

    Declaration

    Swift

    public func setLoggerOnly(logger: CoreCryptoLogger)
  • setMaxLogLevel(level:) From WireCoreCryptoUniffi

    Set maximum log level forwarded to the logger

    Declaration

    Swift

    public func setMaxLogLevel(level: CoreCryptoLogLevel)
  • updateDatabaseKey(name:oldKey:newKey:) Asynchronous, from WireCoreCryptoUniffi

    Updates the key of the CoreCrypto database.

    Declaration

    Swift

    public func updateDatabaseKey(name: String, oldKey: DatabaseKey, newKey: DatabaseKey) async throws
  • version() From WireCoreCryptoUniffi

    The version of core-crypto.

    Declaration

    Swift

    public func version() -> String
  • uniffiEnsureCoreCryptoFfiInitialized() From WireCoreCryptoUniffi

    Undocumented

    Declaration

    Swift

    public func uniffiEnsureCoreCryptoFfiInitialized()