Exception in thread "main" java.io.IOException: error constructing MAC: java.security.NoSuchProviderException: JCE cannot authenticate the provider BC at org.bouncycastle.jce.provider.JDKPKCS12KeyStore.engineLoad(JDKPKCS12KeyStore.java:714) at java.security.KeyStore.load(KeyStore.java:1150)
下载BC的源代码,自己编译之后使用时会抱错;但是使用jar包则正常。因为BC会检查。
java.security.KeyStoreException: TrustedCertEntry not supported
at com.sun.net.ssl.internal.ssl.PKCS12KeyStore.engineSetCertificateEntry(PKCS12KeyStore.java:618)
at java.security.KeyStore.setCertificateEntry(KeyStore.java:909)
PKCS12格式不支持TrustedCertEntry 的导入,要使用TrustedCertEntry 可以使用JKS