要相同的加密类型,才可以。请参考http://www.baidu.com/s?wd=JAVA+%E7%94%A8%E5%85%AC%E9%92%A5%E9%AA%8C%E8%AF%81%E7%AD%BE%E5%90%8D&rsv_spt=1&issp=1&rsv_bp=0&ie=utf-8&tn=baiduhome_pg&rsv_n=2&rsv_sug3=1&inputT=511