Package org.matrix.android.sdk.api.session.crypto.model

Types

Link copied to clipboard
interface AuditInfo
Link copied to clipboard
data class AuditTrail(    val ageLocalTs: Long,     val type: TrailType,     val info: AuditInfo)
Link copied to clipboard
data class CryptoDeviceInfo(    val deviceId: String,     val userId: String,     val algorithms: List<String>? = null,     val keys: Map<String, String>? = null,     val signatures: Map<String, Map<String, String>>? = null,     val unsigned: UnsignedDeviceInfo? = null,     var trustLevel: DeviceTrustLevel? = null,     val isBlocked: Boolean = false,     val firstTimeSeenLocalTs: Long? = null) : CryptoInfo
Link copied to clipboard
data class CryptoRoomInfo(    val algorithm: String,     val shouldEncryptForInvitedMembers: Boolean,     val blacklistUnverifiedDevices: Boolean,     val shouldShareHistory: Boolean,     val wasEncryptedOnce: Boolean,     val rotationPeriodMs: Long,     val rotationPeriodMsgs: Long)
Link copied to clipboard
@JsonClass(generateAdapter = true)
data class DeviceInfo(    @Json(name = "user_id") val userId: String? = null,     @Json(name = "device_id") val deviceId: String? = null,     @Json(name = "display_name") val displayName: String? = null,     @Json(name = "last_seen_ts") val lastSeenTs: Long? = null,     @Json(name = "last_seen_ip") val lastSeenIp: String? = null,     @Json(name = "org.matrix.msc3852.last_seen_user_agent") val unstableLastSeenUserAgent: String? = null,     @Json(name = "last_seen_user_agent") val lastSeenUserAgent: String? = null) : DatedObject

This class describes the device information.

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class DevicesListResponse(@Json(name = "devices") val devices: List<DeviceInfo>? = null)

This class describes the response to https://matrix.org/docs/spec/client_server/r0.4.0.html#get-matrix-client-r0-devices

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class EncryptedFileInfo(    @Json(name = "url") val url: String? = null,     @Json(name = "key") val key: EncryptedFileKey? = null,     @Json(name = "iv") val iv: String? = null,     @Json(name = "hashes") val hashes: Map<String, String>? = null,     @Json(name = "v") val v: String? = null)

In Matrix specs: EncryptedFile.

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class EncryptedFileKey(    @Json(name = "alg") val alg: String? = null,     @Json(name = "ext") val ext: Boolean? = null,     @Json(name = "key_ops") val keyOps: List<String>? = null,     @Json(name = "kty") val kty: String? = null,     @Json(name = "k") val k: String? = null)
Link copied to clipboard
@JsonClass(generateAdapter = true)
data class ForwardedRoomKeyContent(    @Json(name = "algorithm") val algorithm: String? = null,     @Json(name = "room_id") val roomId: String? = null,     @Json(name = "sender_key") val senderKey: String? = null,     @Json(name = "session_id") val sessionId: String? = null,     @Json(name = "session_key") val sessionKey: String? = null,     @Json(name = "forwarding_curve25519_key_chain") val forwardingCurve25519KeyChain: List<String>? = null,     @Json(name = "sender_claimed_ed25519_key") val senderClaimedEd25519Key: String? = null,     @Json(name = "org.matrix.msc3061.shared_history") val sharedHistory: Boolean? = false)

Class representing the forward room key request body content Ref: https://matrix.org/docs/spec/client_server/latest#m-forwarded-room-key

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class ForwardInfo(    val roomId: String,     val sessionId: String,     val senderKey: String,     val alg: String,     val userId: String,     val deviceId: String,     val chainIndex: Long?) : AuditInfo
Link copied to clipboard
interface GossipingToDeviceObject : SendToDeviceObject

Interface representing an room key action request. Note: this class cannot be abstract because of org.matrix.androidsdk.core.JsonUtils.toRoomKeyShare

Link copied to clipboard
data class ImportRoomKeysResult(    val totalNumberOfKeys: Int,     val successfullyNumberOfImportedKeys: Int,     val importedSessionInfo: Map<String, Map<String, List<String>>>)
Link copied to clipboard
@JsonClass(generateAdapter = true)
data class IncomingKeyRequestInfo(    val roomId: String,     val sessionId: String,     val senderKey: String,     val alg: String,     val userId: String,     val deviceId: String,     val requestId: String) : AuditInfo
Link copied to clipboard
data class IncomingRoomKeyRequest(    val userId: String? = null,     val deviceId: String? = null,     val requestId: String? = null,     val requestBody: RoomKeyRequestBody? = null,     val localCreationTimestamp: Long?)

IncomingRoomKeyRequest class defines the incoming room keys request.

Link copied to clipboard
enum MessageVerificationState : Enum<MessageVerificationState>
Link copied to clipboard
@JsonClass(generateAdapter = true)
data class MXDeviceInfo(    @Json(name = "device_id") val deviceId: String,     @Json(name = "user_id") val userId: String,     @Json(name = "algorithms") val algorithms: List<String>? = null,     @Json(name = "keys") val keys: Map<String, String>? = null,     @Json(name = "signatures") val signatures: Map<String, Map<String, String>>? = null,     @Json(name = "unsigned") val unsigned: JsonDict? = null,     val verified: Int = DEVICE_VERIFICATION_UNKNOWN) : Serializable
Link copied to clipboard
data class MXEncryptEventContentResult(val eventContent: Content, val eventType: String)
Link copied to clipboard
data class MXEventDecryptionResult(    val clearEvent: JsonDict,     val senderCurve25519Key: String? = null,     val claimedEd25519Key: String? = null,     val forwardingCurve25519KeyChain: List<String> = emptyList(),     val messageVerificationState: MessageVerificationState? = null)

The result of a (successful) call to decryptEvent.

Link copied to clipboard
class MXUsersDevicesMap<E>
Link copied to clipboard
@JsonClass(generateAdapter = true)
data class OlmDecryptionResult(    @Json(name = "payload") val payload: JsonDict? = null,     @Json(name = "keysClaimed") val keysClaimed: Map<String, String>? = null,     @Json(name = "senderKey") val senderKey: String? = null,     @Json(name = "forwardingCurve25519KeyChain") val forwardingCurve25519KeyChain: List<String>? = null,     @Json(name = "key_safety") val isSafe: Boolean? = null,     @Json(name = "verification_state") val verificationState: MessageVerificationState? = null)

This class represents the decryption result. It's serialized in eventEntity to remember the decryption result

Link copied to clipboard
enum RoomEncryptionTrustLevel : Enum<RoomEncryptionTrustLevel>

RoomEncryptionTrustLevel represents the trust level in an encrypted room.

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class RoomKeyRequestBody(    @Json(name = "algorithm") val algorithm: String? = null,     @Json(name = "room_id") val roomId: String? = null,     @Json(name = "sender_key") val senderKey: String? = null,     @Json(name = "session_id") val sessionId: String? = null)

Class representing an room key request body content.

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class RoomKeyShareRequest(    @Json(name = "action") val action: String? = GossipingToDeviceObject.ACTION_SHARE_REQUEST,     @Json(name = "requesting_device_id") val requestingDeviceId: String? = null,     @Json(name = "request_id") val requestId: String? = null,     @Json(name = "body") val body: RoomKeyRequestBody? = null) : GossipingToDeviceObject

Class representing a room key request content.

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class SecretShareRequest(    @Json(name = "action") val action: String? = GossipingToDeviceObject.ACTION_SHARE_REQUEST,     @Json(name = "requesting_device_id") val requestingDeviceId: String? = null,     @Json(name = "request_id") val requestId: String? = null,     @Json(name = "name") val secretName: String? = null) : GossipingToDeviceObject

Class representing a room key request content.

Link copied to clipboard
interface SendToDeviceObject
Link copied to clipboard
enum TrailType : Enum<TrailType>
Link copied to clipboard
object UnknownInfo : AuditInfo
Link copied to clipboard
@JsonClass(generateAdapter = true)
data class UnsignedDeviceInfo(@Json(name = "device_display_name") val deviceDisplayName: String? = null)
Link copied to clipboard
enum UserVerificationLevel : Enum<UserVerificationLevel>
Link copied to clipboard
@JsonClass(generateAdapter = true)
data class WithheldInfo(    val roomId: String,     val sessionId: String,     val senderKey: String,     val alg: String,     val code: WithHeldCode,     val userId: String,     val deviceId: String) : AuditInfo

Functions

Link copied to clipboard
inline fun <T> MXUsersDevicesMap<T>.forEach(action: (String, String, T) -> Unit)