Android KeyStoreException Unknown Error

I found my answer on the Android Issue Tracker; from what I understand the unrestricted PublicKey, created to work around another known issue, becomes incompatible with the current Cipher. The work-around for this is to specify an OAEPParameterSpec when the Cipher is initialized: OAEPParameterSpec spec = new OAEPParameterSpec( “SHA-256”, “MGF1”, MGF1ParameterSpec.SHA1, PSource.PSpecified.DEFAULT); mCipher.init(opmode, unrestricted, spec);

How Can I Use the Android KeyStore to securely store arbitrary strings?

I started with the premise that I could use AndroidKeyStore to secure arbitrary blobs of data, and call them “keys”. However, the deeper I delved into this, the clearer it became that the KeyStore API is deeply entangled with Security-related objects: Certificates, KeySpecs, Providers, etc. It’s not designed to store arbitrary data, and I don’t … Read more

How do I find out which keystore was used to sign an app?

First, unzip the APK and extract the file /META-INF/ANDROID_.RSA (this file may also be CERT.RSA, but there should only be one .RSA file). Then issue this command: keytool -printcert -file ANDROID_.RSA You will get certificate fingerprints like this: MD5: B3:4F:BE:07:AA:78:24:DC:CA:92:36:FF:AE:8C:17:DB SHA1: 16:59:E7:E3:0C:AA:7A:0D:F2:0D:05:20:12:A8:85:0B:32:C5:4F:68 Signature algorithm name: SHA1withRSA Then use the keytool again to print out all … Read more