当前位置: 代码迷 >> J2SE >> java.security.NoSuchAlgorithmException:   Cannot  
  详细解决方案

java.security.NoSuchAlgorithmException:   Cannot  

热度:325   发布时间:2016-04-24 17:23:13.0
applet与webservice加密通讯的问题??????????
我在applet中调用webservice的方法时,传递了字符串参数,字符串通过      
  public   static   DESTools   getInstance(byte   key[])
                throws   NoSuchPaddingException,   NoSuchAlgorithmException
        {
                DESTools   des   =   new   DESTools();
                if(des.key   ==   null)
                {
                        SecretKeySpec   spec   =   new   SecretKeySpec(key,   "DES ");
                        des.key   =   spec;
                }
                des.cipher   =   Cipher.getInstance( "DES/ECB/PKCS5Padding ");
                return   des;
        }
加密,在ide中运行没有问题,因为用了jdk的环境,但是在ie中运行出现
java.security.NoSuchAlgorithmException:   Cannot   find   any   provider   supporting   DES/ECB/PKCS5Padding这个错误,请问应该怎么做??????



------解决方案--------------------
帮楼主顶上去
------解决方案--------------------
lz在classpath设置一下:路径下的Java\jre1.5.0_05\lib\ext\sunjce_provider.jar

对应着你的jdk路径,在jre下的ext下的sunjce_provider.jar

------解决方案--------------------
可能是你的那个类/包没有找到,你在你的WEB程序里面把你的类/包给引进去试试。
  相关解决方案