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

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

?? manifest.java

?? Examples From Java Examples in a Nutshell, 2nd Edition 書中的源碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright (c) 2000 David Flanagan.  All rights reserved. * This code is from the book Java Examples in a Nutshell, 2nd Edition. * It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied. * You may study, use, and modify it for any non-commercial purpose. * You may distribute it non-commercially as long as you retain this notice. * For a commercial use license, or to purchase the book (recommended), * visit http://www.davidflanagan.com/javaexamples2. */package com.davidflanagan.examples.security;import java.security.*;import java.io.*;import java.util.*;/** * This program creates a manifest file for the specified files, or verifies * an existing manifest file.  By default the manifest file is named * MANIFEST, but the -m option can be used to override this.  The -v * option specifies that the manifest should be verified.  Verification is * also the default option if no files are specified. **/public class Manifest {    public static void main(String[] args) throws Exception {	// Set the default values of the command-line arguments	boolean verify = false;             // Verify manifest or create one?	String manifestfile = "MANIFEST";   // Manifest file name	String digestAlgorithm = "MD5";     // Algorithm for message digests	String signername = null;           // Signer. No sig. by default	String signatureAlgorithm = "DSA";  // Algorithm for digital sig.	String password = null;             // Private keys are protected	File keystoreFile = null;           // Where are keys stored	String keystoreType = null;         // What kind of keystore	String keystorePassword = null;     // How to access keystore	List filelist = new ArrayList();    // The files to digest		// Parse the command-line arguments, overriding the defaults above	for(int i = 0; i < args.length; i++) {	    if (args[i].equals("-v")) verify = true;	    else if (args[i].equals("-m")) manifestfile = args[++i];	    else if (args[i].equals("-da")&& !verify)		digestAlgorithm = args[++i];	    else if (args[i].equals("-s")&& !verify)		signername = args[++i];	    else if (args[i].equals("-sa")&& !verify) 		signatureAlgorithm = args[++i];	    else if (args[i].equals("-p"))		password = args[++i];	    else if (args[i].equals("-keystore"))		keystoreFile = new File(args[++i]);	    else if (args[i].equals("-keystoreType"))		keystoreType = args[++i];	    else if (args[i].equals("-keystorePassword"))		keystorePassword = args[++i];	    else if (!verify) filelist.add(args[i]);	    else throw new IllegalArgumentException(args[i]);	}	// If certain arguments weren't supplied, get default values.	if (keystoreFile == null) {	    File dir = new File(System.getProperty("user.home"));	    keystoreFile = new File(dir, ".keystore");	}	if (keystoreType == null) keystoreType = KeyStore.getDefaultType();	if (keystorePassword == null) keystorePassword = password;	if (!verify && signername != null && password == null) {	    System.out.println("Use -p to specify a password.");	    return;	}	// Get the keystore we'll use for signing or verifying signatures	// If no password was provided, then assume we won't be dealing with 	// signatures, and skip the keystore.	KeyStore keystore = null;	if (keystorePassword != null) {	    keystore = KeyStore.getInstance(keystoreType);	    InputStream in =		new BufferedInputStream(new FileInputStream(keystoreFile));	    keystore.load(in, keystorePassword.toCharArray());	}	// If -v was specified or no file were given, verify a manifest	// Otherwise, create a new manifest for the specified files	if (verify || (filelist.size() == 0)) verify(manifestfile, keystore);	else create(manifestfile, digestAlgorithm,		    signername, signatureAlgorithm,		    keystore, password, filelist);    }        /**     * This method creates a manifest file with the specified name, for     * the specified vector of files, using the named message digest     * algorithm.  If signername is non-null, it adds a digital signature     * to the manifest, using the named signature algorithm.  This method can     * throw a bunch of exceptions.     **/    public static void create(String manifestfile, String digestAlgorithm, 			      String signername, String signatureAlgorithm,			      KeyStore keystore, String password,			      List filelist)	throws NoSuchAlgorithmException, InvalidKeyException, 	       SignatureException, KeyStoreException,	       UnrecoverableKeyException, IOException     {        // For computing a signature, we have to process the files in a fixed,        // repeatable order, so sort them alphabetically.	Collections.sort(filelist);	int numfiles = filelist.size();                Properties manifest = new Properties(), metadata = new Properties();        MessageDigest md = MessageDigest.getInstance(digestAlgorithm);        Signature signature = null;        byte[] digest;                // If a signer name was specified, then prepare to sign the manifest        if (signername != null) {            // Get a Signature object            signature = Signature.getInstance(signatureAlgorithm);	    // Look up the private key of the signer from the keystore	    PrivateKey key = (PrivateKey)		keystore.getKey(signername, password.toCharArray());            // No prepare to create a signature for the specified signer            signature.initSign(key);        }                // Now, loop through the files, in a well-known alphabetical order        System.out.print("Computing message digests");        for(int i = 0; i < numfiles; i++) {	    String filename = (String)filelist.get(i);            // Compute the digest for each, and skip files that don't exist.            try { digest = getFileDigest(filename, md); }             catch (IOException e) {                System.err.println("\nSkipping " + filename + ": " + e);                continue;            }            // If we're computing a signature, use the bytes of the filename             // and of the digest as part of the data to sign.            if (signature != null) {                signature.update(filename.getBytes());                signature.update(digest);            }            // Store the filename and the encoded digest bytes in the manifest            manifest.put(filename, hexEncode(digest));            System.out.print('.');            System.out.flush();        }                // If a signer was specified, compute signature for the manifest        byte[] signaturebytes = null;        if (signature != null) {            System.out.print("done\nComputing digital signature...");            System.out.flush();                        // Compute the digital signature by encrypting a message digest of            // all the bytes passed to the update() method using the private            // key of the signer.  This is a time consuming operation.            signaturebytes = signature.sign();        }	        // Tell the user what comes next        System.out.print("done\nWriting manifest...");        System.out.flush();	        // Store some metadata about this manifest, including the name of the        // message digest algorithm it uses        metadata.put("__META.DIGESTALGORITHM", digestAlgorithm);        // If we're signing the manifest, store some more metadata        if (signername != null) {            // Store the name of the signer            metadata.put("__META.SIGNER", signername);            // Store the name of the algorithm            metadata.put("__META.SIGNATUREALGORITHM", signatureAlgorithm);            // And generate the signature, encode it, and store it            metadata.put("__META.SIGNATURE", hexEncode(signaturebytes));        }	        // Now, save the manifest data and the metadata to the manifest file        FileOutputStream f = new FileOutputStream(manifestfile);        manifest.store(f, "Manifest message digests");        metadata.store(f, "Manifest metadata");

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
春色校园综合激情亚洲| 久久久亚洲综合| 2023国产精品| 亚洲综合一区在线| 国产精品一卡二卡| 精品欧美黑人一区二区三区| 一区二区三区日韩欧美精品 | 亚洲大片免费看| 国产美女在线精品| 欧美老人xxxx18| 亚洲激情五月婷婷| 高清av一区二区| 日韩精品一区二区三区在线| 午夜精品一区二区三区电影天堂 | 欧美电影影音先锋| 亚洲免费观看高清| 日韩精品一区二区三区在线观看 | 日韩av网站免费在线| 91麻豆精品秘密| 国产精品久久毛片a| 国产精品中文欧美| 2024国产精品| 国产一区二区三区视频在线播放| 欧美日韩在线一区二区| 三级一区在线视频先锋| 欧美亚洲日本一区| 亚洲一级二级在线| 精品视频免费在线| 午夜久久久影院| 51精品国自产在线| 秋霞电影网一区二区| 欧美日韩国产不卡| 亚洲h在线观看| 欧美精品日韩精品| 久久精品国产亚洲aⅴ| 欧美一区二区国产| 蜜桃精品在线观看| 精品国产髙清在线看国产毛片| 免费成人在线视频观看| 日韩欧美一级在线播放| 国产在线精品一区二区| 久久久久久久久99精品| 成人爽a毛片一区二区免费| 国产精品久久久久毛片软件| 91色在线porny| 一区二区三区精品在线| 欧美精品久久天天躁| 老汉av免费一区二区三区| 久久精品这里都是精品| 99国产欧美另类久久久精品| 午夜精品一区在线观看| 欧美大片在线观看| 99久久精品国产一区二区三区| 亚洲在线视频一区| 日韩欧美精品三级| 99热99精品| 亚洲sss视频在线视频| 欧美成人vr18sexvr| 成人av电影在线播放| 亚洲高清一区二区三区| 久久无码av三级| 色综合久久综合网97色综合| 热久久免费视频| 国产精品嫩草影院com| 欧美视频一二三区| 国产成人av网站| 亚洲国产中文字幕在线视频综合| 欧美不卡一区二区| 一本到三区不卡视频| 久久99精品久久久久久动态图 | 亚洲va在线va天堂| 久久久午夜精品理论片中文字幕| 99精品久久只有精品| 久久精品国产亚洲高清剧情介绍| 中文字幕一区二区三区蜜月| 欧美日韩成人在线一区| 99这里都是精品| 精品一二线国产| 亚洲国产wwwccc36天堂| 欧美国产禁国产网站cc| 欧美一级日韩一级| 在线观看亚洲精品| 成人午夜在线免费| 麻豆国产精品一区二区三区| 亚洲一区二区欧美日韩| 国产人久久人人人人爽| 欧美一区二区成人6969| 色婷婷综合视频在线观看| 亚洲欧美一区二区三区久本道91 | 不卡的电视剧免费网站有什么| 性做久久久久久免费观看| 欧美国产精品一区二区三区| 精品国产髙清在线看国产毛片| 在线免费av一区| av在线播放一区二区三区| 捆绑调教一区二区三区| 石原莉奈在线亚洲三区| 亚洲国产另类av| 亚洲一区二区三区三| 亚洲免费观看视频| 中文字幕亚洲精品在线观看| 久久久综合视频| 精品少妇一区二区三区视频免付费| 91福利在线导航| 99久久综合色| 99在线精品一区二区三区| 国产盗摄一区二区| 国产精品综合一区二区三区| 久久av资源网| 久久国产精品第一页| 美国毛片一区二区| 蜜乳av一区二区三区| 老鸭窝一区二区久久精品| 美女免费视频一区| 久久av老司机精品网站导航| 免费一级欧美片在线观看| 免费观看成人av| 看电视剧不卡顿的网站| 激情都市一区二区| 国产精品香蕉一区二区三区| 麻豆精品精品国产自在97香蕉| 麻豆极品一区二区三区| 国产一区二区久久| 成人午夜在线播放| 99国产精品久久久久| 91久久精品一区二区二区| 欧美天堂亚洲电影院在线播放| 欧美人伦禁忌dvd放荡欲情| 制服丝袜国产精品| 2020国产精品自拍| 国产精品久久久久婷婷| 亚洲另类春色校园小说| 亚洲国产一区在线观看| 伦理电影国产精品| 成人一区在线看| 91成人在线精品| 91精品国产一区二区人妖| 久久综合久久综合亚洲| 中文字幕中文在线不卡住| 亚洲国产中文字幕| 国产另类ts人妖一区二区| 高清不卡一区二区| 色婷婷精品大在线视频| 8v天堂国产在线一区二区| www一区二区| 一区二区三区精品| 精品一区二区免费在线观看| 9i在线看片成人免费| 欧美二区三区的天堂| 中文字幕乱码日本亚洲一区二区| 一区二区三区精品在线| 狠狠色丁香久久婷婷综合_中| 成人免费毛片app| 91精品国产免费久久综合| 国产精品色在线| 日本午夜精品视频在线观看 | 丁香六月综合激情| 欧美午夜影院一区| 国产亚洲欧美激情| 日韩经典中文字幕一区| 成人黄页在线观看| 日韩女优av电影| 亚洲图片欧美视频| 成人av在线一区二区三区| 欧美日韩夫妻久久| 综合久久久久久| 国产自产视频一区二区三区| 欧美色区777第一页| 国产精品不卡视频| 国产精品一二二区| 日韩视频免费观看高清在线视频| 亚洲视频在线观看三级| 狠狠色丁香婷婷综合| 制服.丝袜.亚洲.另类.中文 | 精品一区二区免费看| 欧美日韩一级大片网址| 亚洲欧洲日本在线| 国产尤物一区二区| 日韩免费观看高清完整版| 亚洲综合成人在线视频| 色综合久久久久| 亚洲色图视频免费播放| 99这里只有久久精品视频| 国产欧美久久久精品影院| 国产精品主播直播| 精品国产免费视频| 久久国产婷婷国产香蕉| 日韩一区二区三区在线视频| 亚洲福中文字幕伊人影院| 欧美在线免费观看视频| 一区二区三区国产精品| 色视频一区二区| 亚洲免费观看高清完整版在线观看 | 美国欧美日韩国产在线播放| 欧美福利电影网| 丝袜美腿亚洲一区| 777色狠狠一区二区三区| 亚洲国产成人av好男人在线观看| 欧美三级电影网站| 午夜精品视频一区|