亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? manifest.java

?? Examples From Java Examples in a Nutshell, 2nd Edition 書中的源碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
        System.out.println("done");    }        /**     * This method verifies the digital signature of the named manifest     * file, if it has one, and if that verification succeeds, it verifies     * the message digest of each file in filelist that is also named in the     * manifest.  This method can throw a bunch of exceptions     **/    public static void verify(String manifestfile, KeyStore keystore) 	throws NoSuchAlgorithmException, SignatureException, 	       InvalidKeyException, KeyStoreException, IOException    {        Properties manifest = new Properties();        manifest.load(new FileInputStream(manifestfile));        String digestAlgorithm =	    manifest.getProperty("__META.DIGESTALGORITHM");        String signername = manifest.getProperty("__META.SIGNER");        String signatureAlgorithm =             manifest.getProperty("__META.SIGNATUREALGORITHM");        String hexsignature = manifest.getProperty("__META.SIGNATURE");	        // Get a list of filenames in the manifest.  	List files = new ArrayList();        Enumeration names = manifest.propertyNames();        while(names.hasMoreElements()) {            String s = (String)names.nextElement();            if (!s.startsWith("__META")) files.add(s);        }	int numfiles = files.size();		// If we've got a signature but no keystore, warn the user	if (signername != null && keystore == null)	    System.out.println("Can't verify digital signature without " +			       "a keystore.");        // If the manifest contained metadata about a digital signature, then        // verify that signature first        if (signername != null && keystore != null) {            System.out.print("Verifying digital signature...");            System.out.flush();            // To verify the signature, we must process the files in exactly            // the same order we did when we created the signature.  We            // guarantee this order by sorting the filenames.	    Collections.sort(files);	                // Create a Signature object to do signature verification with.	    // Initialize it with the signer's public key from the keystore            Signature signature = Signature.getInstance(signatureAlgorithm);	    PublicKey publickey =		keystore.getCertificate(signername).getPublicKey();            signature.initVerify(publickey);	                // Now loop through these files in their known sorted order For            // each one, send the bytes of the filename and of the digest to            // the signature object for use in computing the signature.  It is            // important that this be done in exactly the same order when            // verifying the signature as it was done when creating the            // signature.            for(int i = 0; i < numfiles; i++) {		String filename = (String) files.get(i);                signature.update(filename.getBytes());                signature.update(hexDecode(manifest.getProperty(filename)));            }	                // Now decode the signature read from the manifest file and pass            // it to the verify() method of the signature object.  If the            // signature is not verified, print an error message and exit.            if (!signature.verify(hexDecode(hexsignature))) {                System.out.println("\nManifest has an invalid signature");                System.exit(0);            }                        // Tell the user we're done with this lengthy computation            System.out.println("verified.");        }        // Tell the user we're starting the next phase of verification        System.out.print("Verifying file message digests");        System.out.flush();	        // Get a MessageDigest object to compute digests        MessageDigest md = MessageDigest.getInstance(digestAlgorithm);        // Loop through all files        for(int i = 0; i < numfiles; i++) {	    String filename = (String)files.get(i);            // Look up the encoded digest from the manifest file            String hexdigest = manifest.getProperty(filename);            // Compute the digest for the file.            byte[] digest;            try { digest = getFileDigest(filename, md); }             catch (IOException e) {                System.out.println("\nSkipping " + filename + ": " + e);                continue;            }            // Encode the computed digest and compare it to the encoded digest            // from the manifest.  If they are not equal, print an error            // message.            if (!hexdigest.equals(hexEncode(digest)))                System.out.println("\nFile '" + filename +				   "' failed verification.");	                // Send one dot of output for each file we process.  Since            // computing message digests takes some time, this lets the user            // know that the program is functioning and making progress            System.out.print(".");             System.out.flush();        }        // And tell the user we're done with verification.        System.out.println("done.");    }        /**     * This convenience method is used by both create() and verify().  It     * reads the contents of a named file and computes a message digest     * for it, using the specified MessageDigest object.     **/    public static byte[] getFileDigest(String filename, MessageDigest md) 	throws IOException {        // Make sure there is nothing left behind in the MessageDigest        md.reset();	        // Create a stream to read from the file and compute the digest        DigestInputStream in =             new DigestInputStream(new FileInputStream(filename),md);	        // Read to the end of the file, discarding everything we read.        // The DigestInputStream automatically passes all the bytes read to        // the update() method of the MessageDigest        while(in.read(buffer) != -1) /* do nothing */ ;	        // Finally, compute and return the digest value.        return md.digest();    }        /** This static buffer is used by getFileDigest() above */    public static byte[] buffer = new byte[4096];        /** This array is used to convert from bytes to hexadecimal numbers */    static final char[] digits = { '0', '1', '2', '3', '4', '5', '6', '7',				   '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};        /**     * A convenience method to convert an array of bytes to a String.  We do     * this simply by converting each byte to two hexadecimal digits.     * Something like Base 64 encoding is more compact, but harder to encode.     **/    public static String hexEncode(byte[] bytes) {        StringBuffer s = new StringBuffer(bytes.length * 2);        for(int i = 0; i < bytes.length; i++) {            byte b = bytes[i];            s.append(digits[(b& 0xf0) >> 4]);            s.append(digits[b& 0x0f]);        }        return s.toString();    }        /**     * A convenience method to convert in the other direction, from a string     * of hexadecimal digits to an array of bytes.     **/    public static byte[] hexDecode(String s) throws IllegalArgumentException {        try {            int len = s.length();            byte[] r = new byte[len/2];            for(int i = 0; i < r.length; i++) {                int digit1 = s.charAt(i*2), digit2 = s.charAt(i*2 + 1);                if ((digit1 >= '0')&& (digit1 <= '9')) digit1 -= '0';                else if ((digit1 >= 'a')&& (digit1 <= 'f')) digit1 -= 'a' - 10;                if ((digit2 >= '0')&& (digit2 <= '9')) digit2 -= '0';                else if ((digit2 >= 'a')&& (digit2 <= 'f')) digit2 -= 'a' - 10;                r[i] = (byte)((digit1 << 4) + digit2);            }            return r;        }        catch (Exception e) {            throw new IllegalArgumentException("hexDecode(): invalid input");        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美美女一区二区| 色综合中文综合网| 久久不见久久见免费视频7 | 色综合久久久久久久久久久| 欧美韩国日本综合| 91农村精品一区二区在线| 中文字幕一区二区视频| 一本久久a久久免费精品不卡| 国产精品二三区| 日本高清免费不卡视频| 亚洲一区在线视频观看| 欧美一区二区大片| 国产精品小仙女| 一区二区三区高清不卡| 91精品久久久久久久久99蜜臂| 久久99精品国产.久久久久久| 国产欧美一区二区精品秋霞影院| 成人免费av网站| 亚洲午夜激情网页| 日韩欧美在线影院| 成人97人人超碰人人99| 亚洲第一电影网| 亚洲精品一区二区三区影院| 成人免费视频视频在线观看免费| 亚洲欧美激情视频在线观看一区二区三区| 欧美日韩一区精品| 国产一区二区91| 亚洲综合一区二区| 国产亚洲1区2区3区| 在线观看国产精品网站| 国产在线播放一区三区四| 亚洲精品成人天堂一二三| 日韩午夜精品视频| 色哟哟精品一区| 黄色日韩网站视频| 亚洲高清视频在线| 亚洲国产岛国毛片在线| 欧美日本在线视频| 9l国产精品久久久久麻豆| 日韩精品成人一区二区在线| 亚洲国产成人在线| 欧美一级高清片| 91蜜桃传媒精品久久久一区二区| 日本色综合中文字幕| 一色桃子久久精品亚洲| 日韩免费高清视频| 欧美午夜视频网站| 波多野结衣视频一区| 日本女人一区二区三区| 亚洲精品免费播放| 中文字幕精品一区二区三区精品| 日韩一级完整毛片| 欧美吻胸吃奶大尺度电影 | 99久久精品国产观看| 久久国产麻豆精品| 青青草成人在线观看| 亚洲综合免费观看高清完整版| 国产日韩欧美精品综合| 欧美videossexotv100| 欧美卡1卡2卡| 欧日韩精品视频| 成人高清免费观看| 国产不卡免费视频| 国产呦萝稀缺另类资源| 麻豆精品国产传媒mv男同| 午夜精品影院在线观看| 亚洲精品免费在线观看| 《视频一区视频二区| 欧美国产精品v| 久久蜜桃av一区二区天堂| 亚洲精品一区在线观看| 欧美成人伊人久久综合网| 欧美一级在线观看| 日韩欧美中文字幕制服| 精品美女在线播放| 欧美tickling网站挠脚心| 欧美一级精品在线| 欧美一二三四区在线| 日韩免费成人网| 5858s免费视频成人| 精品1区2区3区| 欧美日韩在线综合| 91精品久久久久久久久99蜜臂| 欧美美女bb生活片| 91精品国产色综合久久| 91精品在线一区二区| 91精品国产入口| 欧美一区二区三区免费| 精品久久久久久综合日本欧美| 日韩精品一区二区三区蜜臀| 欧美精品一区二| 欧美国产成人精品| 亚洲免费观看高清| 石原莉奈一区二区三区在线观看| 蜜桃久久久久久久| 国产精品一区二区男女羞羞无遮挡| 国产精品1024久久| 99久久er热在这里只有精品66| 色综合久久精品| 69堂成人精品免费视频| 精品噜噜噜噜久久久久久久久试看 | 99久久精品国产麻豆演员表| 91行情网站电视在线观看高清版| 精品污污网站免费看| 欧美电影免费观看高清完整版在线| 久久一夜天堂av一区二区三区| 国产日产欧产精品推荐色| 亚洲三级在线免费观看| 夜夜嗨av一区二区三区中文字幕| 日韩va亚洲va欧美va久久| 狠狠色狠狠色综合日日91app| 国产成都精品91一区二区三| 色婷婷精品大视频在线蜜桃视频| 欧美日韩精品一区二区在线播放| 精品国产乱码久久久久久闺蜜 | 亚洲免费视频中文字幕| 同产精品九九九| 狠狠色丁香久久婷婷综合_中| 成人免费视频视频| 91精品在线一区二区| 国产精品国产三级国产aⅴ原创 | 国内精品免费**视频| 99精品视频一区二区三区| 欧美精品丝袜中出| 国产精品国产三级国产普通话99| 五月天激情小说综合| 成人福利电影精品一区二区在线观看| 欧美亚洲动漫另类| 国产亚洲精品超碰| 亚洲va天堂va国产va久| www.欧美亚洲| 精品卡一卡二卡三卡四在线| 亚洲自拍偷拍欧美| 国产精品一二一区| 欧美精品成人一区二区三区四区| 国产精品天天看| 免费看日韩a级影片| 在线观看成人免费视频| 国产嫩草影院久久久久| 久久精品免费观看| 欧美日韩精品欧美日韩精品| 中文字幕日韩精品一区| 激情小说亚洲一区| 欧美一区二区网站| 一区二区三区产品免费精品久久75| 国产盗摄精品一区二区三区在线 | 99久久99久久免费精品蜜臀| 亚洲精品一区二区三区影院| 日韩成人午夜精品| 欧美丝袜丝nylons| 国产精品久久久久影院老司| 国产麻豆视频一区| 日韩欧美国产一区二区在线播放| 午夜精品影院在线观看| 色综合久久天天综合网| 中文字幕欧美国产| 国产精品77777| 久久亚洲综合色一区二区三区| 日本成人中文字幕| 欧美福利一区二区| 日韩专区欧美专区| 91精品国产综合久久精品| 亚洲一区av在线| 色94色欧美sute亚洲线路一久| 国产精品伦理一区二区| 风间由美性色一区二区三区| 久久免费看少妇高潮| 国产一区二区毛片| 久久久.com| 成人永久看片免费视频天堂| 国产三级一区二区| jlzzjlzz欧美大全| 亚洲欧洲美洲综合色网| 91在线视频免费观看| 亚洲免费av观看| 欧美色涩在线第一页| 午夜电影一区二区| 91精品国产乱码| 久久福利资源站| 国产偷国产偷精品高清尤物| 国产成人av电影在线播放| 国产精品美女久久久久久久久久久| 不卡的电视剧免费网站有什么| 国产精品午夜久久| 91免费看`日韩一区二区| 亚洲综合视频在线观看| 制服丝袜中文字幕一区| 久久超碰97人人做人人爱| 国产欧美va欧美不卡在线| 成人av影院在线| 一区二区三区在线免费视频| 欧美二区在线观看| 狠狠色丁香久久婷婷综合丁香| 日本一区二区三级电影在线观看 | 国内精品久久久久影院色| 中文字幕+乱码+中文字幕一区| 91在线视频18| 午夜精品久久久| 久久免费偷拍视频| 一本大道久久a久久精二百|