ProteusClient

interface ProteusClient

Samples

import com.wire.kalium.cryptography.CryptoClientId
import com.wire.kalium.cryptography.CryptoSessionId
import com.wire.kalium.cryptography.CryptoUserID
import com.wire.kalium.cryptography.ProteusClient
fun main() { 
   //sampleStart 
   val messageData = byteArrayOf(0x42, 0x69)
val payload: ByteArray = proteusClient.encrypt(
    messageData,
    CryptoSessionId(cryptoUserId, cryptoClientId)
) 
   //sampleEnd
}

Inheritors

Functions

Link copied to clipboard
abstract suspend fun close()
Link copied to clipboard
abstract suspend fun createSession(preKeyCrypto: PreKeyCrypto, sessionId: CryptoSessionId)
Link copied to clipboard
suspend fun ProteusClient.createSessions(preKeysCrypto: Map<String, Map<String, Map<String, PreKeyCrypto>>>)
Link copied to clipboard
abstract suspend fun <T : Any> decrypt(message: ByteArray, sessionId: CryptoSessionId, handleDecryptedMessage: suspend (decryptedMessage: ByteArray) -> T): T

Decrypts a message. In case of success, calls handleDecryptedMessage with the decrypted bytes.

Link copied to clipboard
abstract suspend fun deleteSession(sessionId: CryptoSessionId)
Link copied to clipboard
abstract suspend fun doesSessionExist(sessionId: CryptoSessionId): Boolean
Link copied to clipboard
abstract suspend fun encrypt(message: ByteArray, sessionId: CryptoSessionId): ByteArray
Link copied to clipboard
abstract suspend fun encryptBatched(message: ByteArray, sessionIds: List<CryptoSessionId>): Map<CryptoSessionId, ByteArray>
Link copied to clipboard
abstract suspend fun encryptWithPreKey(message: ByteArray, preKeyCrypto: PreKeyCrypto, sessionId: CryptoSessionId): ByteArray
Link copied to clipboard
abstract suspend fun getFingerprintFromPreKey(preKey: PreKeyCrypto): ByteArray
Link copied to clipboard
abstract fun getIdentity(): ByteArray
Link copied to clipboard
abstract suspend fun getLocalFingerprint(): ByteArray
Link copied to clipboard
abstract suspend fun newLastResortPreKey(): PreKeyCrypto
Link copied to clipboard
abstract suspend fun newPreKeys(from: Int, count: Int): List<PreKeyCrypto>
Link copied to clipboard
abstract suspend fun remoteFingerPrint(sessionId: CryptoSessionId): ByteArray