我现在在做一个项目,用到 NUIMCSCGIBE 这个提供者,当我用到下面代码时
Cipher cipher = null;
try {
cipher = Cipher.getInstance( IbeProvider.IBE, provider );
}
catch( NoSuchAlgorithmException nsae ) {
// handle exception
nsae.printStackTrace();
}
catch( NoSuchPaddingException nspe ) {
// handle exception
nspe.printStackTrace();
}
出现了如下错误,
Exception in thread "main" java.lang.SecurityException: JCE cannot authenticate the provider NUIMCSCGIBE
at javax.crypto.Cipher.getInstance(DashoA13*..)
at test.ibetest.main(ibetest.java:31)
Caused by: java.util.jar.JarException: Class is on the bootclasspath
at javax.crypto.SunJCE_c.a(DashoA13*..)
at javax.crypto.SunJCE_b.b(DashoA13*..)
at javax.crypto.SunJCE_b.a(DashoA13*..)
... 2 more我已经做的一些事就是,将ibe_fat.jar 签名了,然后在java.security里面也增加了那句security.provider.n= ****
而且我写这段代码
Provider[] p = Security.getProviders();
for (int i = 0; i < p.length; i++) {
System.out.println(p[i].getName());
}
会输出
SUN
SunRsaSign
SunJSSE
SunJCE
SunJGSS
SunSASL
XMLDSig
SunPCSC
SunMSCAPI
NUIMCSCGIBE
那么到底要怎样的去签名才可以使得jce可以鉴别,
Cipher cipher = null;
try {
cipher = Cipher.getInstance( IbeProvider.IBE, provider );
}
catch( NoSuchAlgorithmException nsae ) {
// handle exception
nsae.printStackTrace();
}
catch( NoSuchPaddingException nspe ) {
// handle exception
nspe.printStackTrace();
}
出现了如下错误,
Exception in thread "main" java.lang.SecurityException: JCE cannot authenticate the provider NUIMCSCGIBE
at javax.crypto.Cipher.getInstance(DashoA13*..)
at test.ibetest.main(ibetest.java:31)
Caused by: java.util.jar.JarException: Class is on the bootclasspath
at javax.crypto.SunJCE_c.a(DashoA13*..)
at javax.crypto.SunJCE_b.b(DashoA13*..)
at javax.crypto.SunJCE_b.a(DashoA13*..)
... 2 more我已经做的一些事就是,将ibe_fat.jar 签名了,然后在java.security里面也增加了那句security.provider.n= ****
而且我写这段代码
Provider[] p = Security.getProviders();
for (int i = 0; i < p.length; i++) {
System.out.println(p[i].getName());
}
会输出
SUN
SunRsaSign
SunJSSE
SunJCE
SunJGSS
SunSASL
XMLDSig
SunPCSC
SunMSCAPI
NUIMCSCGIBE
那么到底要怎样的去签名才可以使得jce可以鉴别,
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货