【发布时间】:2011-10-15 19:50:42
【问题描述】:
在我的应用程序中,我正在使用 SHA1 和 RSA 验证使用概率签名方案 (PSS) 签名的文件的数字签名。签名是在 BouncyCastle 的帮助下在 J2SE 中创建的。
到目前为止,在 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 版本)?
谢谢!
【问题讨论】: