This repository was archived by the owner on Feb 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Blob messages
Přemysl Šťastný edited this page Aug 29, 2018
·
8 revisions
Please, read Basic concepts of application before reading this.
Server sends blob messages to client encrypted by AES. After decryption descripted here, the clients get "file" (lets call it JsonCapsula) in unparsed form.
This chapter is using the encoding convention. Let's have empty stream s. When is JsonCapsula creating, the JsonType (int
) is written to s. There are 4 JsonTypes:
-
ALARM = 1
-{String Date, String Text}
-
CONTACT = 2
-{Number PublicId, String UserName, String PublicCertificate, Boolean Trusted, String SendAesKey, String ReceiveAesKey, Boolean AlarmPermission, String NickName}
-
MESSAGES_THREAD = 3
-{String Name, Boolean Onlive, Boolean Archived, Number WithUserId, Number PublicId, Boolean DoOnlyDelete}
-
MESSAGES = 4
-{Number MessageThreadId, String Text, String Time}
After that a json is created by serialization and written to s. JsonCapsula can contain binary attachment. If so, 1 (int
) is written to s and attachment (byte[]
) after it. If not, 0 (int
) is written to s.
Finally, the content of s is encrypted by AES using the encryption convention.