CoreCrypto

public final class CoreCrypto : CoreCryptoProtocol

CoreCrypto client which manages one cryptographic client for proteus and MLS.

  • init(database:) Asynchronous

    Initialise CoreCrypto with an encrypted key store.

    Declaration

    Swift

    public convenience init(database: Database) async throws

    Parameters

    keystorePath

    path to the encrypted key store

    key

    secret key to unlock the encrypted key store

  • historyClient(_:) Asynchronous

    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 static func historyClient(_ historySecret: HistorySecret) async throws -> CoreCrypto
  • transaction(_:) Asynchronous

    Declaration

    Swift

    public func transaction<Result>(
        _ block: @escaping (_ context: CoreCryptoContextProtocol) async throws -> Result
    ) async throws -> Result
  • Declaration

    Swift

    public func provideTransport(transport: any MlsTransport) async throws
  • Declaration

    Swift

    public func registerEpochObserver(_ epochObserver: EpochObserver) async throws
  • Declaration

    Swift

    public func registerHistoryObserver(_ historyObserver: HistoryObserver) async throws
  • Declaration

    Swift

    public func isHistorySharingEnabled(conversationId: ConversationId) async throws -> Bool
  • Returns the last resort PreKey id

    Declaration

    Swift

    public static func proteusLastResortPrekeyId() throws -> UInt16
  • Proteus public key fingerprint It’s basically the public key encoded as an hex string

    Returns Hex-encoded public key string

    Declaration

    Swift

    public static func proteusFingerprintPrekeybundle(prekey: Data) throws -> String