CoreCryptoProtocol
public protocol CoreCryptoProtocol : CoreCryptoFfiProtocol
Defines the protocol for a client.
-
historyClient(_:Asynchronous) Instantiate a history client.
This client exposes the full interface of
Self, but it should only be used to decrypt messages. Other use is a logic error.Declaration
Swift
static func historyClient(_ historySecret: HistorySecret) async throws -> Self -
transaction(_:Asynchronous) Starts a transaction in Core Crypto. If the closure succeeds without throwing an error, it will be committed, otherwise, every operation performed with the context will be discarded.
Declaration
Swift
func transaction<Result>( _ block: @escaping (_ context: CoreCryptoContextProtocol) async throws -> Result ) async throws -> ResultParameters
blockthe closure to be executed within the transaction context. A
CoreCryptoContextis provided on which any operations should be performed.Return Value
Result value returned from the closure if any.