There are a lot of examples how to deal with an p12 certificate to use it in an App for client authentication. e.g.:
InputStream is = context.getResources().openRawResource(R.raw.client_cert);
Base64InputStream b64is = new Base64InputStream(is, Base64.DEFAULT);
char[] tableauCertPassword = certPassword.toCharArray();
// Import PKCS12 in KeyStore
KeyStore appKeyStore = KeyStore.getInstance("PKCS12");
appKeyStore.load(b64is, tableauCertPassword);
is.close();
b64is.close();
// lnit keyManagerFactory with Client Certificate's keyStore
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("X509");
keyManagerFactory.init(appKeyStore, tableauCertPassword);
KeyManager[] keyManagers = keyManagerFactory.getKeyManagers();
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(keyManagers, tmf.getTrustManagers(), null);
But I don't want to store my client certificate within the app in the raw directory, right?
The P12 will be provided during the provisioning in the KeyStore of Android, right?
So how I can use the p12 certificate which is stored in KeyStore.getInstance("AndroidKeyStore")
,
to do an ok http call within client certificate.