How to organize a https connection in android? For starters, go over the diagram to make it clearer what I exactly want:
- The client asks the server for a secure connection and sends data about the used algorithm, encryption etc
- The server sends a certificate with a key
- The client checks the certificate for validity
- If all the rules, then send to serv a generated key for a symmetric encryption, I encrypted the public key of the server
- The server is accepting, this is to confirm that the connection is established
- Then I send all messages encrypting them before this key,the server decrypts them
So start to ask the correct schema (if not then tell me what is wrong and where)? If so, how do I do all this client-side logic , namely How to handle the certificate generate key add MAC to the query and so on. With the help of some libraries to do this?
P. s I understand that the question is very General, so you can just describe General tools and brief explanations-recommendations to them, but if you decide to write a detailed answer I would be very grateful.
P. p.s everything I read on the Internet has not brought any clarity about how to arrange this connection from a to I.