CoreCrypto
public final class CoreCrypto : CoreCryptoProtocol, @unchecked Sendable
CoreCrypto client which manages one cryptographic client for proteus and MLS.
-
Initialise CoreCrypto with an encrypted key store.
Declaration
Swift
public convenience init(database: Database) throwsParameters
keystorePathpath to the encrypted key store
keysecret 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 -
registerEpochObserver(epochObserver:Asynchronous) Declaration
Swift
public func registerEpochObserver(epochObserver: EpochObserver) async throws -
registerHistoryObserver(historyObserver:Asynchronous) Declaration
Swift
public func registerHistoryObserver(historyObserver: HistoryObserver) async throws -
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 -
conversationCipherSuite(conversationId:Asynchronous) Undocumented
Declaration
Swift
public func conversationCipherSuite(conversationId: ConversationId) async throws -> CipherSuite -
conversationCredential(conversationId:Asynchronous) Undocumented
Declaration
Swift
public func conversationCredential(conversationId: ConversationId) async throws -> CredentialRef -
conversationEpoch(conversationId:Asynchronous) Undocumented
Declaration
Swift
public func conversationEpoch(conversationId: ConversationId) async throws -> UInt64 -
conversationExists(conversationId:Asynchronous) Undocumented
Declaration
Swift
public func conversationExists(conversationId: ConversationId) async throws -> Bool -
e2eiConversationState(conversationId:Asynchronous) Undocumented
Declaration
Swift
public func e2eiConversationState(conversationId: ConversationId) async throws -> E2eiConversationState -
e2eiIsEnabled(cipherSuite:Asynchronous) Undocumented
Declaration
Swift
public func e2eiIsEnabled(cipherSuite: CipherSuite) async throws -> Bool -
e2eiIsPkiEnvSetup()AsynchronousUndocumented
Declaration
Swift
public func e2eiIsPkiEnvSetup() async -> Bool -
exportSecretKey(conversationId:AsynchronouskeyLength: ) Undocumented
Declaration
Swift
public func exportSecretKey(conversationId: ConversationId, keyLength: UInt32) async throws -> SecretKey -
Undocumented
Declaration
Swift
public func findCredentials(clientId: ClientId? = nil, publicKey: Data? = nil, cipherSuite: CipherSuite? = nil, credentialType: CredentialType? = nil, earliestValidity: UInt64? = nil) async throws -> [CredentialRef] -
getClientIds(conversationId:Asynchronous) Undocumented
Declaration
Swift
public func getClientIds(conversationId: ConversationId) async throws -> [ClientId] -
getCredentials()AsynchronousUndocumented
Declaration
Swift
public func getCredentials() async throws -> [CredentialRef] -
getDeviceIdentities(conversationId:AsynchronousdeviceIds: ) Undocumented
Declaration
Swift
public func getDeviceIdentities(conversationId: ConversationId, deviceIds: [ClientId]) async throws -> [WireIdentity] -
getExternalSender(conversationId:Asynchronous) Undocumented
Declaration
Swift
public func getExternalSender(conversationId: ConversationId) async throws -> ExternalSender -
getPkiEnvironment()AsynchronousUndocumented
Declaration
Swift
public func getPkiEnvironment() async -> PkiEnvironment? -
getUserIdentities(conversationId:AsynchronoususerIds: ) Undocumented
Declaration
Swift
public func getUserIdentities(conversationId: ConversationId, userIds: [Uuid]) async throws -> [Uuid : [WireIdentity]] -
isHistorySharingEnabled(conversationId:Asynchronous) Undocumented
Declaration
Swift
public func isHistorySharingEnabled(conversationId: ConversationId) async throws -> Bool -
proteusFingerprint()AsynchronousUndocumented
Declaration
Swift
public func proteusFingerprint() async throws -> String -
proteusFingerprintLocal(sessionId:Asynchronous) Undocumented
Declaration
Swift
public func proteusFingerprintLocal(sessionId: String) async throws -> String -
proteusFingerprintRemote(sessionId:Asynchronous) Undocumented
Declaration
Swift
public func proteusFingerprintRemote(sessionId: String) async throws -> String -
proteusSessionExists(sessionId:Asynchronous) Undocumented
Declaration
Swift
public func proteusSessionExists(sessionId: String) async throws -> Bool -
publicKey(credentialRef:Asynchronous) Undocumented
Declaration
Swift
public func publicKey(credentialRef: CredentialRef) async throws -> Data -
setPkiEnvironment(pkiEnvironment:Asynchronous) Undocumented
Declaration
Swift
public func setPkiEnvironment(pkiEnvironment: PkiEnvironment? = nil) async -
transactionFfi(command:Asynchronous) Undocumented
Declaration
Swift
public func transactionFfi(command: CoreCryptoCommand) async throws