您无法使用由AndroidKeyStore管理的密钥对BC / SC进行解密,因为私钥内容受到保护,并且隐藏了参数(例如私有指数),因此任何使用该密钥初始化密码的尝试都将失败。
错误消息 No provider for RSA/ECB/OAEPwithSHA-512andMGF1Padding 使用SC可能是由于库的错误处理不正确,但是 private exponent cannot be extracted error 因为BC很清楚。加密有效,因为它使用的公钥不受保护。
No provider for RSA/ECB/OAEPwithSHA-512andMGF1Padding
private exponent cannot be extracted error
你需要使用 AndroidKeyStore 用于解密(或使用SC / BC也生成密钥)
AndroidKeyStore