我想在我的應用程序來測試一個密鑰簽名,但不能越過加載從資產密鑰庫,因爲錯誤被拋出:JCE無法驗證提供商公元前Robolectric
java.io. IOException異常:錯誤構建MAC: java.lang.SecurityException異常:JCE不能驗證提供商BC
這裏是代碼
@Test public void testKeyStore() { try { KeyStore keyStore = KeyStore.getInstance("PKCS12"); InputStream inputStream = RuntimeEnvironment.application.getAssets().open(fileName); keyStore.load(inputStream, password.toCharArray()); } catch (Exception e) { e.printStackTrace(); } }
如果不是Robolectric,有沒有人有一個想法如何運行這個測試? 謝謝
你想要測試什麼?您實際上不需要Robolectric這個java代碼 –