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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 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");

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产激情91久久精品导航| 99久久精品费精品国产一区二区| 国内精品视频666| 91在线看国产| 久久久亚洲国产美女国产盗摄| 亚洲永久免费av| av网站免费线看精品| 精品国产免费人成在线观看| 亚洲国产精品久久艾草纯爱| 成人午夜精品一区二区三区| 欧美成人一区二区三区| 亚洲国产精品人人做人人爽| 成人免费黄色大片| 日韩女优电影在线观看| 日韩av在线免费观看不卡| 94-欧美-setu| 国产丝袜美腿一区二区三区| 奇米一区二区三区| 欧美猛男gaygay网站| 亚洲欧洲色图综合| 成a人片国产精品| 久久婷婷成人综合色| 极品少妇一区二区三区精品视频| 7777精品伊人久久久大香线蕉完整版 | 亚洲综合999| www.亚洲精品| 国产精品三级电影| 国产河南妇女毛片精品久久久| 欧美大片一区二区三区| 蜜臀av性久久久久蜜臀aⅴ四虎 | av亚洲精华国产精华精| 中文字幕乱码亚洲精品一区| 国产精品一品视频| 中文字幕乱码日本亚洲一区二区 | 亚洲色图一区二区| av中文字幕不卡| 亚洲欧洲日韩一区二区三区| 成人污视频在线观看| 国产精品乱子久久久久| zzijzzij亚洲日本少妇熟睡| 国产精品国产三级国产| 99精品在线观看视频| 亚洲女爱视频在线| 欧美日韩在线播放三区四区| 亚洲成av人影院| 欧美一区二区视频在线观看2020| 日韩福利电影在线观看| 欧美一区二区在线播放| 久久激情五月激情| 国产日产精品一区| 91亚洲精品久久久蜜桃网站| 亚洲成精国产精品女| 欧美一区二区大片| 国产乱人伦精品一区二区在线观看 | 久久久电影一区二区三区| 国产99久久久国产精品潘金 | 国产精品乱码一区二三区小蝌蚪| gogo大胆日本视频一区| 亚洲成人1区2区| 久久久久国产一区二区三区四区 | 国产精品人妖ts系列视频| 99国内精品久久| 日韩电影在线免费| 国产色产综合产在线视频| 色综合色狠狠综合色| 日本不卡视频一二三区| 国产精品免费视频观看| 7777精品久久久大香线蕉 | 日本网站在线观看一区二区三区| 精品国产区一区| 日本电影欧美片| 精品中文av资源站在线观看| 亚洲天堂av一区| 日韩精品一区二区三区在线观看| 成人不卡免费av| 免费高清在线视频一区·| 国产精品视频免费| 日韩一级高清毛片| 91香蕉国产在线观看软件| 免费一区二区视频| 一区二区三区免费| 久久久国产午夜精品| 欧美猛男男办公室激情| 99国内精品久久| 国产一区二区在线免费观看| 亚洲成国产人片在线观看| 国产精品免费久久| 久久综合色天天久久综合图片| 91福利视频在线| 粉嫩久久99精品久久久久久夜| 视频在线观看91| 亚洲欧美日韩精品久久久久| 精品国产乱码久久久久久蜜臀 | 蜜桃av一区二区| 亚洲影院理伦片| 亚洲人成伊人成综合网小说| 久久久久久久久久电影| 正在播放亚洲一区| 欧美吻胸吃奶大尺度电影| 国产69精品久久久久毛片| 久久精品99国产国产精| 天堂一区二区在线免费观看| 亚洲大片在线观看| 亚洲综合一二三区| 亚洲综合无码一区二区| 亚洲精品国产视频| 国产精品久久久久久久久免费樱桃 | 日本色综合中文字幕| 亚洲永久精品大片| 亚洲一区二区视频| 亚洲成人资源在线| 亚洲va韩国va欧美va| 亚洲成人tv网| 日韩国产欧美一区二区三区| 日韩精品亚洲一区| 日韩在线a电影| 日韩高清不卡在线| 蜜臀av性久久久久蜜臀aⅴ| 蜜臀久久久久久久| 久久国产夜色精品鲁鲁99| 麻豆成人免费电影| 国产精品99久久久久久有的能看| 久久69国产一区二区蜜臀| 久久66热偷产精品| 成人中文字幕在线| 色国产综合视频| 在线电影国产精品| 日韩一级完整毛片| 精品国产一区二区三区忘忧草 | 麻豆国产精品官网| 国产精品综合在线视频| 成人激情动漫在线观看| 91在线视频免费观看| 色欧美片视频在线观看在线视频| 91国偷自产一区二区开放时间| 欧美日韩在线观看一区二区| 欧美电影免费观看高清完整版在线观看 | 日日摸夜夜添夜夜添精品视频 | 91福利在线导航| 在线91免费看| 久久综合99re88久久爱| 久久久噜噜噜久噜久久综合| 国产精品久久久久久久久久免费看 | 欧美激情在线观看视频免费| 亚洲丝袜制服诱惑| 男人的天堂亚洲一区| 国产一区在线精品| 91同城在线观看| 日韩视频在线你懂得| 国产精品看片你懂得| 首页国产丝袜综合| 国产激情一区二区三区| 欧洲精品一区二区| 久久久国产午夜精品 | 国产精品私人影院| 亚洲国产精品嫩草影院| 国产精品99久久久久久似苏梦涵| 在线国产电影不卡| 久久久精品国产免大香伊| 亚洲一区二区视频在线| 黑人精品欧美一区二区蜜桃| 色国产综合视频| 国产精品天天看| 另类小说综合欧美亚洲| 欧美日韩综合在线免费观看| 国产精品久久久久影院老司| 久久国产欧美日韩精品| 欧美三片在线视频观看 | 午夜欧美电影在线观看| 成人免费看黄yyy456| 日韩免费高清电影| 亚洲最色的网站| 成人av资源站| 久久久久久**毛片大全| 久久精品国产99国产| 欧美午夜片在线观看| 亚洲私人黄色宅男| 国产不卡高清在线观看视频| 日韩欧美综合一区| 午夜a成v人精品| 欧美性猛交xxxx黑人交| 国产精品另类一区| 精品中文字幕一区二区| 欧美二区在线观看| 亚洲精品一区二区三区在线观看| 亚洲免费在线视频一区 二区| 免费在线观看一区二区三区| 在线观看欧美精品| 欧美国产精品v| 麻豆专区一区二区三区四区五区| 精品一区二区三区影院在线午夜 | 欧美大片国产精品| 国产日产欧美一区| 久久99精品国产91久久来源| 欧美主播一区二区三区美女| 亚洲一区在线播放| av不卡一区二区三区| 国产亚洲自拍一区| 久久精品国产精品亚洲精品| 欧美日韩国产大片|