title: Issue with Robolectric with cipher in android application
body: <p>Hi I am using Robolectric for test cases. I am facing some issue while simulating for encryption relateed test cases. I tried to use cipher with AES for encryption. And it is giving me some error. I tried it in following manner : </p>
  
  <pre><code>    @Test
  public void testGet() {
      Cipher cipher = null;
      try {
          SecretKey sks= getKeySpec(pass, salt);
          cipher = Cipher.getInstance("AES");
          cipher.init(Cipher.DECRYPT_MODE, sks);
      } catch (NoSuchAlgorithmException e) {
          e.printStackTrace();
      } catch (NoSuchPaddingException e) {
          e.printStackTrace();
      } catch (InvalidKeySpecException e) {
          e.printStackTrace();
      } catch (InvalidKeyException e) {
          e.printStackTrace();
      }
  }
  
  public SecretKey getKeySpec(char[] pass, byte[] salt) throws NoSuchAlgorithmException, InvalidKeySpecException {
  
      //generate key spec...
      return secretKeyFactory.generateSecret(keySpec);
  }
  </code></pre>
  
  <p>It gives me following error :</p>
  
  <pre><code>Illegal key size or default parameters
  </code></pre>
  
  <p>I already added <code>JCE</code> for illegal size exception. It is working if I run it on device and properly working in my application. Only thing when I try with robolectric it is giving me this error.Need some help. Thank you.</p>