Functions
The following functions are available globally.
-
uniffiForeignFutureHandleCountCoreCryptoFfi()From WireCoreCryptoUniffiUndocumented
Declaration
Swift
public func uniffiForeignFutureHandleCountCoreCryptoFfi() -> Int -
buildMetadata()From WireCoreCryptoUniffiReturns build metadata for CoreCrypto.
Declaration
Swift
public func buildMetadata() -> BuildMetadata -
ciphersuiteDefault()From WireCoreCryptoUniffiGet 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 -
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 -> CoreCryptoFfi -
coreCryptoNew(database:From WireCoreCryptoUniffi) Construct a new
CoreCryptoFfiinstance.MLS or Proteus can be initialized via
mls_initorproteus_initon aCoreCryptoContextobtained through a transaction.Declaration
Swift
public func coreCryptoNew(database: Database) throws -> CoreCryptoFfi -
createPkiEnvironment(hooks:Asynchronous, from WireCoreCryptoUniffidatabase: ) Create a new PKI environment.
Declaration
Swift
public func createPkiEnvironment(hooks: PkiEnvironmentHooks, database: Database) async throws -> PkiEnvironment -
exportDatabaseCopy(database:Asynchronous, from WireCoreCryptoUniffidestinationPath: ) Export a fully vacuumed and optimized copy of the database to the specified path.
The copy is created using SQLite’s VACUUM INTO command and is encrypted with the same key as the source database. This is only available on platforms using SQLCipher (iOS, Android, JVM, native).
Declaration
Swift
public func exportDatabaseCopy(database: Database, destinationPath: String) async throws -
inMemoryDatabase(key:Asynchronous, from WireCoreCryptoUniffi) Create an in-memory database whose data will be lost when the instance is dropped.
Declaration
Swift
public func inMemoryDatabase(key: DatabaseKey) async throws -> Database -
migrateDatabaseKeyTypeToBytes(path:Asynchronous, from WireCoreCryptoUniffioldKey: newKey: ) Updates the key of the CoreCrypto database.
This function is intended to be called only once, when migrating from CoreCrypto 5.x to 6.x.
Declaration
Swift
public func migrateDatabaseKeyTypeToBytes(path: String, oldKey: String, newKey: DatabaseKey) async throws -
openDatabase(location:Asynchronous, from WireCoreCryptoUniffikey: ) Open or create a database.
Declaration
Swift
public func openDatabase(location: String, key: DatabaseKey) async throws -> Database -
proteusFingerprintPrekeybundleFfi(prekey:From WireCoreCryptoUniffi) Returns the hex-encoded fingerprint of the identity key contained in the given prekey bundle.
Declaration
Swift
public func proteusFingerprintPrekeybundleFfi(prekey: Data) throws -> String -
proteusLastResortPrekeyIdFfi()From WireCoreCryptoUniffiReturns the Proteus last resort prekey ID.
The last resort prekey is a special prekey retained after all other prekeys have been consumed, ensuring a session can always be established. Its ID is always
u16::MAX(65535).Declaration
Swift
public func proteusLastResortPrekeyIdFfi() throws -> UInt16 -
setLogger(logger:From WireCoreCryptoUniffi) Initializes the logger.
Declaration
Swift
public func setLogger(logger: CoreCryptoLogger) -
setMaxLogLevel(level:From WireCoreCryptoUniffi) Sets the maximum log level forwarded to the logger.
Declaration
Swift
public func setMaxLogLevel(level: CoreCryptoLogLevel) -
version()From WireCoreCryptoUniffiThe version of
core-crypto.Declaration
Swift
public func version() -> String -
uniffiEnsureCoreCryptoFfiInitialized()From WireCoreCryptoUniffiUndocumented
Declaration
Swift
public func uniffiEnsureCoreCryptoFfiInitialized()
Functions Reference