我已经在我的机器上成功安装了密码库,所以安装后我看到这些行jre\lib\security\java.security
:
security.provider.11=ru.CryptoPro.JCP.JCP
security.provider.12=ru.CryptoPro.Crypto.CryptoProvider
security.provider.13=ru.CryptoPro.reprov.RevCheck
security.provider.14=ru.CryptoPro.ssl.Provider
security.provider.15=ru.CryptoPro.JCSP.JCSP
这些行java.security
自动出现在文件中。此外,当我导入所需的模块时,我没有收到任何错误:
import ru.CryptoPro.JCP.*;
import ru.CryptoPro.JCP.KeyStore.*;
import ru.CryptoPro.JCP.params.JCPProtectionParameter;
import ru.CryptoPro.JCSP.JCSP;
完全没问题。但是,当我在代码中添加一个小命令时:
KeyStore ks = KeyStore.getInstance("REGISTRY", JCSP.PROVIDER_NAME);
我得到一长串错误:
java.security.NoSuchProviderException: no such provider: JCSP at
sun.security.jca.GetInstance.getService(Unknown Source) at
sun.security.jca.GetInstance.getInstance(Unknown Source) at
java.security.Security.getImpl(Unknown Source) at
java.security.KeyStore.getInstance(Unknown Source) at
com.test.examples.Test.doGet(Test.java:40) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at
... list goes on
这些错误消息的可能原因是什么?