Using TLS in Android

流过昼夜 提交于 2019-12-25 06:30:47

问题


I'm developing an Android application that communicates with my device(ARM based device with bluetooth module) via bluetooth using TLS(TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256). What I considered:

  1. javax.net.ssl from Android. Problem is that ephemeral(ECDHE) encryption keys are starting from API 20 but I need API 11. I didn't find a way to add suite. It seems that this library is strongly related to android version. API versions and overview
  2. Bouncycastle(spongycastle) I didn't find a way to use it without creating a socket. I need something like in/out streams so I could use it not with the network connection. Also I didn't find TLS/SSL at all.
  3. Implementing everything by myself. I could take all algorithms from selected suite and implement protocol by myself but I don't know what I don't know and I'm afraid to screw up security. I don't know if it's a good practice to do such a thing(may be it's high level enough so it's not very dangerous to implement it by myself)

My question is: which libraries could you recommend for TLS? Is it a good way to implement the protocol(not algorithms) by myself?

来源:https://stackoverflow.com/questions/38422947/using-tls-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!