SecurityException: JCE cannot authenticate the provider BC

SecurityException: JCE cannot authenticate the provider BC_第1张图片

网上原因众说纷纭,试了好多没一个能解决这个问题的,原因感觉应该是:

 “SecurityException: JCE cannot authenticate the provider BC” 这样的错误,通常意味着Java加密扩展(JCE)无法验证加载的加密提供者,即找不到Bouncy Castle,或者Bouncy Castle有多个,再或者Bouncy Castle版本不对等。

报错很奇怪,缺少这个库,应该报错:“...notFound...”,但是它报错:ecurityException: JCE cannot authenticate the provider BC的。

jdk11中,hutool报错:


    cn.hutool
    hutool-all
    5.3.1

添加指定的:bcprov-jdk18on依赖就好了


    org.bouncycastle
    bcprov-jdk18on
    1.77

完。 

SecurityException: JCE cannot authenticate the provider BC_第2张图片

你可能感兴趣的:(java,同态加密)