在我的應用程序中,我正在使用SHA1和RSA驗證使用概率簽名方案(PSS)簽名的文件的數字簽名。簽名是在BouncyCastle的幫助下在J2SE中創建的。自Android 2.3以來,PSS簽名驗證失敗
在Android應用程序中,此驗證迄今運行良好(例如2.1,2.2)。在Android 2.3設備/模擬器上測試應用程序時,我收到NoSuchAlgorithmException。
NoSuchAlgorithmException: Signature SHA1withRSA/PSS implementation not found
相關的代碼我使用驗證簽名如下:
Signature signature = Signature.getInstance("SHA1withRSA/PSS", "BC");
signature.setParameter(new PSSParameterSpec(64));
signature.initVerify(thePublicKey);
signature.update(theMessage.getBytes());
boolean signatureIsValid = signature.verify(theSignature);
發生了什麼事,因爲Android 2.2系統,爲什麼算法「SHA1withRSA/PSS」,從「BC」提供者取消?
有沒有人可以選擇(最好適用於所有Android版本)?
謝謝!