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

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

?? manifest.java

?? 共有164個java源程序
?? 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一区二区三区免费野_久草精品视频
国产 欧美在线| 五月激情综合网| 91精品国产色综合久久ai换脸| 久草这里只有精品视频| 亚洲人成网站影音先锋播放| 久久综合一区二区| 91成人国产精品| 成人中文字幕在线| 精品亚洲porn| 天天综合天天综合色| 中文字幕一区二区视频| 日韩一区二区三| 色综合天天天天做夜夜夜夜做| 免费欧美在线视频| 国产精品国产a| 久久精品日韩一区二区三区| 欧美一区二区三区免费视频| 欧美在线你懂的| 中文字幕欧美激情一区| 国产自产视频一区二区三区| 日韩欧美视频一区| 日韩精品电影在线| 欧美mv日韩mv亚洲| 国产精品18久久久久久久网站| 久久亚区不卡日本| 99精品视频在线播放观看| 亚洲黄色av一区| 欧美亚洲综合在线| 韩国精品久久久| 一区二区视频在线看| 欧美xxxx老人做受| 欧美午夜理伦三级在线观看| 麻豆91在线播放免费| 亚洲免费av网站| 欧美电影免费提供在线观看| 日本精品视频一区二区| 国产成人精品免费一区二区| 国产a级毛片一区| 99精品欧美一区二区蜜桃免费| 狠狠v欧美v日韩v亚洲ⅴ| 日本人妖一区二区| 欧美成人a在线| 免费在线看一区| 久久精品亚洲一区二区三区浴池 | 91精品91久久久中77777| 在线电影院国产精品| 国内久久精品视频| 亚洲一区在线看| 午夜视频在线观看一区二区三区| 亚洲电影一区二区| 福利电影一区二区| 国产成人在线观看免费网站| 国产成人精品综合在线观看| 国产精品综合二区| 国产91丝袜在线观看| 91丨九色丨黑人外教| 欧美日韩一区二区电影| 3d成人h动漫网站入口| 精品国产免费视频| 国产精品色眯眯| 一区二区日韩av| 麻豆精品视频在线观看免费| 国产一区二区调教| eeuss鲁一区二区三区| 欧美综合天天夜夜久久| 日韩美女视频在线| 国产欧美一区二区精品仙草咪| 亚洲日韩欧美一区二区在线| 丝袜诱惑亚洲看片| 精品一区二区日韩| 91网站最新地址| 正在播放亚洲一区| 欧美激情一区在线观看| 亚洲午夜精品久久久久久久久| 男女男精品视频| 99久久夜色精品国产网站| 777欧美精品| 中文在线资源观看网站视频免费不卡| 一区二区三区不卡视频| 国产一区二区电影| 精品视频一区二区三区免费| 久久精品欧美日韩| 舔着乳尖日韩一区| 99综合影院在线| 欧美成人性战久久| 亚洲综合无码一区二区| 国产精品18久久久久久vr| 欧美三级电影一区| 国产精品久久久久久久蜜臀| 日本亚洲天堂网| 一本到高清视频免费精品| 日韩欧美国产一区二区在线播放| 国产精品毛片a∨一区二区三区| 水野朝阳av一区二区三区| av在线不卡观看免费观看| 日韩视频一区二区| 一区二区三区成人在线视频| 日韩精品成人一区二区三区| 成人免费视频免费观看| 4438x成人网最大色成网站| 亚洲摸摸操操av| 国产美女精品一区二区三区| 欧美日韩在线亚洲一区蜜芽| 国产精品久久国产精麻豆99网站| 久色婷婷小香蕉久久| 欧美午夜影院一区| 18涩涩午夜精品.www| 激情综合网天天干| 欧美一卡2卡3卡4卡| 亚洲一级片在线观看| 91视频.com| 国产精品国产三级国产| 国产电影精品久久禁18| 欧美精品一区视频| 日本欧美一区二区三区| 欧美美女直播网站| 成人永久免费视频| 欧美精品一区二区三区视频| 天天色天天操综合| 欧美精品在线视频| 一区二区三区精品视频| www.在线欧美| 国产精品久久久久久久久图文区 | 成人教育av在线| 久久久久久久电影| 国产剧情在线观看一区二区| 日韩一卡二卡三卡四卡| 亚洲va欧美va人人爽午夜| 91老师国产黑色丝袜在线| 亚洲视频每日更新| 日韩三级在线观看| 国产成人亚洲综合a∨婷婷 | 一区二区三区鲁丝不卡| 色琪琪一区二区三区亚洲区| 日韩精品成人一区二区在线| 精品免费日韩av| av不卡一区二区三区| 偷拍日韩校园综合在线| 国产亚洲一区字幕| 色婷婷综合久久久久中文一区二区| 亚洲第一狼人社区| 国产精品久久久久毛片软件| 欧美三级欧美一级| 国产精品资源在线观看| 日产国产高清一区二区三区| 欧美电视剧在线看免费| 欧美v日韩v国产v| 日韩一区二区精品葵司在线 | 亚洲观看高清完整版在线观看| 欧美xxxxxxxxx| 成人综合婷婷国产精品久久免费| 国产精品99久久久久久似苏梦涵| 欧美日韩免费高清一区色橹橹| 91免费国产在线观看| 欧美调教femdomvk| 日韩专区在线视频| 精品国产免费一区二区三区四区| 国产一区免费电影| 欧美国产成人在线| 91黄色小视频| 久久精品国产免费看久久精品| 久久久久国产精品麻豆| 99久久婷婷国产综合精品电影| 一区二区三区欧美视频| 日韩一区二区三区视频在线| 国产成人免费视频网站高清观看视频 | 国产69精品一区二区亚洲孕妇| 亚洲色图视频免费播放| 5566中文字幕一区二区电影| 国产精品自拍av| 亚洲伊人色欲综合网| 日韩一级片网站| 99久精品国产| 奇米在线7777在线精品| 国产日韩在线不卡| 欧美日本一区二区| 成人免费视频国产在线观看| 亚洲丰满少妇videoshd| 久久婷婷成人综合色| 在线免费一区三区| 久久99热99| 一区二区三区中文在线| 久久先锋影音av鲁色资源网| 91视频91自| 毛片av中文字幕一区二区| 亚洲天堂av一区| 精品久久久久久无| 欧美日韩中文字幕精品| 成人一区二区视频| 日精品一区二区| 亚洲欧美另类久久久精品2019| 欧美mv和日韩mv国产网站| 91浏览器打开| 高清beeg欧美| 免费成人在线视频观看| 亚洲激情自拍偷拍| 国产校园另类小说区| 日韩午夜激情电影| 在线视频你懂得一区| 成人av网站免费|