Make fewer assumptions in AndroidKeyStoreTest.

This removes the following assumptions from the test:
* PrivateKey instances returned by Android Keystore are instances of
  ECPrivateKey or RSAPrivateKey. The assumption is wrong because these
  two interfaces require that key material is exported. The correct
  approach is to require only that the keys are instances of
  PrivateKey and ECKey or RSAKey.
* RSA Cipher.getBlockSize returns the size of RSA modulus in bytes.
  This is not always the case. It's best to explicitly use modulus
  size in testKeyStore_Encrypting_RSA_NONE_NOPADDING.

Bug: 18088752
Change-Id: I323f67a0a22ac068deeaae873bfe7e8f66a2254f
1 file changed