Android - How to store certificate in keystore programmatically?

后端 未结 1 702
别那么骄傲
别那么骄傲 2021-02-06 10:39

I am making a financial transaction android app. It requires SSL authentication and I successfully able to complete it(handshake between Android and Tomcat). I used keytool and

相关标签:
1条回答
  • 2021-02-06 10:52
    • Your issue is not with the keystore itself, but rather with the location of the file where you're trying to store the new client certificate!
    • The "RAW-folder" is part of your installed application package. So you can "virtually" access it, and only READ, not WRITE!
    • Your best option, if you want your keystore to be private, is your application sandboxed-private-folder(Internal storage).
      You can't write in the RAW-folder, but you can write in your application private folder.
    • In the link that you provided, the storage/write location is in fact the private folder. So it didn't work for you because you're trying to "write in the Raw-Folder"
    • You probably know that already, but you can copy your file(R.raw.client) from the "Raw-folder" to your application private folder. That way, you only use one keystore file(readable and writable).
    0 讨论(0)
提交回复
热议问题