Android KeyChain.createInstallIntent returning immediately -
In my Android app, I try to install a PKCS 12 file (certificate and private key) retrieved from my server I am doing To do this, I am using KeyChain.createInstallIntent ()
. I go through the file and name to use as Xtra, then use startActivityForResult
to close the activity.
This is working on my Galaxy Tab 2 4.1.1 works fine on Jelly Bean However, opening the system dialogue to install the certificate as the candidate, running 4.4.2 KitKat on my Galaxy Tab 3 , The onActivityResult
method is immediately called a result code of RESULT_CANCELLED
.
The app is trying to get the notified of the success / failure of the certificate, then open a browser window and go to the success or failure page accordingly.
Secure void importPkcs12 (Byte [] pkcs12, String default name) {Intent Installintent = Ki.Credit InstantIntent (); InstallIntent.putExtra (keys. XTRA_PKCS12, pkcs12); InstallIntent.putExtra (KeyChain.EXTRA_NAME, defaultName); StartActivityForResult (installIntent, INSTALL_KEYSTORE_CODE); } @ Override Protective Result (Int Requestcode, Int Formcode, Intent Data) on Protected Z. {Logger.Debug ("ActiveActive Requestor Code {}", called with RequestCode); Switch (requestcode) {case INSTALL_KEYSTORE_CODE: {if (resultCode == RESULT_OK) {// go to the success web page} and / / RESULT_CANCELED // break the // canceled / failed web page}; }} Super.onActivityResult (requestCode, ResultsCode, Data); }
There is a ticket for it :.
As a solution, you can use the Broadcast receiver with a mainstore-replacement event, when the user actually sets up the certificate, but it is clearly making several assumptions , And this does not let you capture the actual cancellation incident further. / P>
Comments
Post a Comment