1.Android 9.0 起,不再支持BC提供者的加密算法
例如:
KeyPairGenerator.getInstance("RSA", "BC");
将抛出java.security.NoSuchAlgorithmException:The BC provider no longer provides an implementation for RSA.
修改方案: 使用默认RSA , KeyPairGenerator.getInstance("RSA");
2.生成证书申请的CSR
PKCS10CertificationRequest request = new PKCS10CertificationRequest(
MD5WITHRSA,
new X509Principal(DN),
publicKey,
null,
privateKey);
抛出异常:java.security.NoSuchAlgorithmException: The BC provider no longer provides an implementation for Signature.MD5withRSA. Please see https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html for more details.