Functions
The following functions are available globally.
-
uniffiForeignFutureHandleCountCoreCryptoFfi()From WireCoreCryptoUniffiUndocumented
Declaration
Swift
public func uniffiForeignFutureHandleCountCoreCryptoFfi() -> Int -
cipherSuiteDefault()From WireCoreCryptoUniffiGet an instance of the default cipher suite.
Declaration
Swift
public func cipherSuiteDefault() -> CipherSuite -
cipherSuiteFromU16(discriminant:From WireCoreCryptoUniffi) Construct a cipher suite enum instance from its discriminant.
Declaration
Swift
public func cipherSuiteFromU16(discriminant: UInt16) throws -> CipherSuite -
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 -
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) -
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 -
inMemoryDatabase()Asynchronous, from WireCoreCryptoUniffiCreate an in-memory database whose data will be lost when the instance is dropped.
Declaration
Swift
public func inMemoryDatabase() async throws -> Database -
openDatabase(location:Asynchronous, from WireCoreCryptoUniffikey: ) Open or create a database.
Declaration
Swift
public func openDatabase(location: String, 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 -
x509CredentialAcquisitionNewFromCredentialRef(pkiEnvironment:Asynchronous, from WireCoreCryptoUnifficonfig: credentialRef: coreCryptoDatabase: ) Create a new credential acquisition from an existing credential. This API is temporary until our system decouples client identities from a client’s public signature key. See https://wearezeta.atlassian.net/wiki/x/RABtrQ.
Provide
core_crypto_databaseif you’re using distinct DB instances forPkiEnvironmentandCoreCrypto. Otherwise, thePkiEnvironment‘s DB will be used to load the full credential.Declaration
Swift
public func x509CredentialAcquisitionNewFromCredentialRef(pkiEnvironment: PkiEnvironment, config: X509CredentialAcquisitionConfiguration, credentialRef: CredentialRef, coreCryptoDatabase: Database? = nil) async throws -> X509CredentialAcquisition -
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 -
buildMetadata()From WireCoreCryptoUniffiReturns build metadata for CoreCrypto.
Declaration
Swift
public func buildMetadata() -> BuildMetadata -
version()From WireCoreCryptoUniffiThe version of
core-crypto.Declaration
Swift
public func version() -> String -
createPkiEnvironment(hooks:Asynchronous, from WireCoreCryptoUniffidatabase: ) Create a new PKI environment.
Declaration
Swift
public func createPkiEnvironment(hooks: PkiEnvironmentHooks, database: Database) async throws -> PkiEnvironment -
uniffiEnsureCoreCryptoFfiInitialized()From WireCoreCryptoUniffiUndocumented
Declaration
Swift
public func uniffiEnsureCoreCryptoFfiInitialized()
Functions Reference