I am trying to make a connection via my Android client to my server. The server is HTTPS. To make the client connect to the server I used a client.key and client.crt that was signed via the same CA .crt file as the server and converted to a .p12 format. The client is supposed to have the private key and public key. But the client shouldn't have the server private key. The only way to get Android to work is to load in a p12 file from the server into the TrustManagerFactory
. But this is not the right way since the private key from the server is inside that file. The TrustManagerFactory
doesn't allow me to load in a .crt file.
My question is: How do I load a .crt file into KeyStore
instead of the p12 I am using now. Or do I need to use something else then the KeyStore
.