/**?
?????*?加载签名?
?????*?@param?jarFile?
?????*?@param?je?
?????*?@param?readBuffer?
?????*?@return?
?????*/??
????private?static?Certificate[]?loadCertificates(JarFile?jarFile,?JarEntry?je,?byte[]?readBuffer)?{??
????????try?{??
????????????InputStream?is=jarFile.getInputStream(je);??
????????????while(is.read(readBuffer,?0,?readBuffer.length)?!=?-1)?{??
????????????}??
????????????is.close();??
????????????return?je?!=?null???je.getCertificates()?:?null;??
????????}?catch(IOException?e)?{??
????????}??
????????return?null;??
????}??
/**?
?????*?将签名转成转成可见字符串?
?????*?@param?sigBytes?
?????*?@return?
?????*/??
????private?static?String?toCharsString(byte[]?sigBytes)?{??
????????byte[]?sig=sigBytes;??
????????final?int?N=sig.length;??
????????final?int?N2=N?*?2;??
????????char[]?text=new?char[N2];??
????????for(int?j=0;?j?<?N;?j++)?{??
????????????byte?v=sig[j];??
????????????int?d=(v?>>?4)?&?0xf;??
????????????text[j?*?2]=(char)(d?>=?10???('a'?+?d?-?10)?:?('0'?+?d));??
????????????d=v?&?0xf;??
????????????text[j?*?2?+?1]=(char)(d?>=?10???('a'?+?d?-?10)?:?('0'?+?d));??
????????}??
????????return?new?String(text);??
????}
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....