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

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

?? sampleazn.java

?? Sun公司官方網(wǎng)站上下載的JDK文檔
?? JAVA
字號:
/* * @(#)SampleAzn.java * * Copyright 2001-2002 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or  * without modification, are permitted provided that the following  * conditions are met: *  * -Redistributions of source code must retain the above copyright   * notice, this  list of conditions and the following disclaimer. *  * -Redistribution in binary form must reproduct the above copyright  * notice, this list of conditions and the following disclaimer in  * the documentation and/or other materials provided with the  * distribution. *  * Neither the name of Sun Microsystems, Inc. or the names of  * contributors may be used to endorse or promote products derived  * from this software without specific prior written permission. *  * This software is provided "AS IS," without a warranty of any  * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND  * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY  * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY  * DAMAGES OR LIABILITIES  SUFFERED BY LICENSEE AS A RESULT OF  OR  * RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR  * ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE  * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT,  * SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER  * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF  * THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. *  * You acknowledge that Software is not designed, licensed or  * intended for use in the design, construction, operation or  * maintenance of any nuclear facility.  */package sample;import java.io.*;import java.util.*;import java.security.Principal;import java.security.PrivilegedAction;import javax.security.auth.*;import javax.security.auth.callback.*;import javax.security.auth.login.*;import javax.security.auth.spi.*;import com.sun.security.auth.*;/** * <p> This Sample application attempts to authenticate a user * and executes a SampleAction as that user. * * <p> If the user successfully authenticates itself, * the username and number of Credentials is displayed. */public class SampleAzn {    /**     * Attempt to authenticate the user.     *     * <p>     *      * @param args input arguments for this application.  These are ignored.     */     public static void main(String[] args) {	// Obtain a LoginContext, needed for authentication. Tell it 	// to use the LoginModule implementation specified by the 	// entry named "Sample" in the JAAS login configuration 	// file and to also use the specified CallbackHandler.	LoginContext lc = null;	try {	    lc = new LoginContext("Sample", new MyCallbackHandler());	} catch (LoginException le) {	    System.err.println("Cannot create LoginContext. "	        + le.getMessage());	    System.exit(-1);	} catch (SecurityException se) {	    System.err.println("Cannot create LoginContext. "	        + se.getMessage());	    System.exit(-1);	} 	// the user has 3 attempts to authenticate successfully	int i;	for (i = 0; i < 3; i++) {	    try {		// attempt authentication		lc.login();		// if we return with no exception, authentication succeeded		break;	    } catch (LoginException le) {		  System.err.println("Authentication failed:");		  System.err.println("  " + le.getMessage());		  try {		      Thread.currentThread().sleep(3000);		  } catch (Exception e) {		      // ignore		  } 		    }	}	// did they fail three times?	if (i == 3) {	    System.out.println("Sorry");	    System.exit(-1);	}	System.out.println("Authentication succeeded!");	Subject mySubject = lc.getSubject();	// let's see what Principals we have	Iterator principalIterator = mySubject.getPrincipals().iterator();	System.out.println("Authenticated user has the following Principals:");	while (principalIterator.hasNext()) {	    Principal p = (Principal)principalIterator.next();	    System.out.println("\t" + p.toString());	}	System.out.println("User has " +			mySubject.getPublicCredentials().size() +			" Public Credential(s)");	// now try to execute the SampleAction as the authenticated Subject	PrivilegedAction action = new SampleAction();	Subject.doAsPrivileged(mySubject, action, null);	System.exit(0);    }}/** * A CallbackHandler implemented by the application. * * <p> This application is text-based.  Therefore it displays information * to the user using the OutputStreams System.out and System.err, * and gathers input from the user using the InputStream System.in. */class MyCallbackHandler implements CallbackHandler {    /**     * Invoke an array of Callbacks.     *     * <p>     *     * @param callbacks an array of <code>Callback</code> objects which contain     *			the information requested by an underlying security     *			service to be retrieved or displayed.     *     * @exception java.io.IOException if an input or output error occurs. <p>     *     * @exception UnsupportedCallbackException if the implementation of this     *			method does not support one or more of the Callbacks     *			specified in the <code>callbacks</code> parameter.     */    public void handle(Callback[] callbacks)    throws IOException, UnsupportedCallbackException {      	for (int i = 0; i < callbacks.length; i++) {	    if (callbacks[i] instanceof TextOutputCallback) {      		// display the message according to the specified type		TextOutputCallback toc = (TextOutputCallback)callbacks[i];		switch (toc.getMessageType()) {		case TextOutputCallback.INFORMATION: 		    System.out.println(toc.getMessage()); 		    break; 		case TextOutputCallback.ERROR: 		    System.out.println("ERROR: " + toc.getMessage()); 		    break; 		case TextOutputCallback.WARNING: 		    System.out.println("WARNING: " + toc.getMessage()); 		    break; 		default: 		    throw new IOException("Unsupported message type: " + 					toc.getMessageType()); 		}  	    } else if (callbacks[i] instanceof NameCallback) {   		// prompt the user for a username 		NameCallback nc = (NameCallback)callbacks[i];   		System.err.print(nc.getPrompt()); 		System.err.flush(); 		nc.setName((new BufferedReader			(new InputStreamReader(System.in))).readLine());  	    } else if (callbacks[i] instanceof PasswordCallback) {   		// prompt the user for sensitive information 		PasswordCallback pc = (PasswordCallback)callbacks[i]; 		System.err.print(pc.getPrompt()); 		System.err.flush(); 		pc.setPassword(readPassword(System.in));   	    } else { 		throw new UnsupportedCallbackException 			(callbacks[i], "Unrecognized Callback"); 	    }	}    }       // Reads user password from given input stream.    private char[] readPassword(InputStream in) throws IOException {		char[] lineBuffer;	char[] buf;	int i;	buf = lineBuffer = new char[128];	int room = buf.length;	int offset = 0;	int c;loop:	while (true) { 	    switch (c = in.read()) { 	    case -1: 	    case '\n':		break loop; 	    case '\r': 		int c2 = in.read(); 		if ((c2 != '\n') && (c2 != -1)) { 		    if (!(in instanceof PushbackInputStream)) { 			in = new PushbackInputStream(in); 		    } 		    ((PushbackInputStream)in).unread(c2); 		} else 		    break loop; 	    default: 		if (--room < 0) { 		    buf = new char[offset + 128]; 		    room = buf.length - offset - 1; 		    System.arraycopy(lineBuffer, 0, buf, 0, offset); 		    Arrays.fill(lineBuffer, ' '); 		    lineBuffer = buf; 		} 		buf[offset++] = (char) c; 		break; 	    } 	} 	if (offset == 0) { 	    return null; 	} 	char[] ret = new char[offset]; 	System.arraycopy(buf, 0, ret, 0, offset); 	Arrays.fill(buf, ' '); 	return ret;    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美日韩在线不卡| 国产毛片精品一区| 欧美夫妻性生活| 欧美日韩一本到| 色综合激情五月| 精品久久人人做人人爽| 亚洲精品一区在线观看| 国产天堂亚洲国产碰碰| 国产日韩欧美精品在线| 国产清纯白嫩初高生在线观看91| 中文字幕在线观看不卡| 国产欧美综合在线观看第十页 | 欧美一级精品大片| 亚洲婷婷综合久久一本伊一区| 91麻豆国产精品久久| 香蕉成人伊视频在线观看| 日韩欧美你懂的| 国产**成人网毛片九色| 亚洲一区二区三区激情| 日韩网站在线看片你懂的| jlzzjlzz欧美大全| 天天射综合影视| 久久综合久色欧美综合狠狠| 99re6这里只有精品视频在线观看| 午夜视频久久久久久| 国产午夜亚洲精品羞羞网站| 欧美性欧美巨大黑白大战| 久久99久久久久| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 欧美日韩免费高清一区色橹橹| 男女性色大片免费观看一区二区 | 亚洲国产精品久久一线不卡| 精品久久久久一区二区国产| 99久久免费视频.com| 奇米四色…亚洲| 樱桃国产成人精品视频| 精品国产三级a在线观看| 97久久超碰精品国产| 六月丁香婷婷色狠狠久久| 亚洲欧美偷拍另类a∨色屁股| 欧美不卡在线视频| 91国偷自产一区二区使用方法| 国产一区二区伦理| 午夜欧美电影在线观看| 国产精品日韩精品欧美在线| 欧美一卡二卡在线观看| 色综合久久久久| 粉嫩嫩av羞羞动漫久久久| 青青草91视频| 亚洲一区二区三区在线| 国产精品久久久久久久久久久免费看| 7777精品伊人久久久大香线蕉 | 欧美日韩一区二区在线视频| 国产成人精品午夜视频免费| 日本视频一区二区| 久久精品国产一区二区三区免费看| 日本不卡中文字幕| 亚洲午夜激情网页| 日本一二三四高清不卡| 制服丝袜亚洲精品中文字幕| 色哟哟一区二区| 9l国产精品久久久久麻豆| 亚洲男人的天堂在线aⅴ视频| 欧美r级电影在线观看| 欧美日韩综合在线| 一本久道久久综合中文字幕 | 国内精品久久久久影院色| 亚洲高清免费在线| 亚洲国产一区二区在线播放| 亚洲六月丁香色婷婷综合久久 | 亚洲精品视频在线看| 国产精品少妇自拍| 国产欧美在线观看一区| 国产午夜精品一区二区三区视频| 亚洲精品一区二区三区99| 欧美一激情一区二区三区| 欧美精品日韩一区| 欧美另类videos死尸| 欧美女孩性生活视频| 在线免费观看日本欧美| 欧美曰成人黄网| 欧美午夜一区二区三区| 欧美精品aⅴ在线视频| 这里只有精品99re| 日韩欧美中文字幕制服| 欧美精品一区二区三区在线播放| 精品久久久久久久久久久久久久久久久 | 日本亚洲电影天堂| 免费在线一区观看| 久久99精品国产麻豆婷婷洗澡| 精品一区二区三区av| 蜜臀av性久久久久av蜜臀妖精 | 亚洲欧洲性图库| 精品久久久久久亚洲综合网| 欧美mv日韩mv国产网站app| 欧美在线free| 欧美精品在线视频| 亚洲人精品一区| 一区二区三区日韩| 亚洲成人精品一区| 美女精品自拍一二三四| 精品一区二区三区视频在线观看| 国产成人自拍高清视频在线免费播放| 波多野结衣在线一区| 色女孩综合影院| 欧美一二三四在线| 日本一区二区成人在线| 亚洲成人手机在线| 国产真实乱子伦精品视频| 99久久99久久免费精品蜜臀| 欧美日韩中文国产| 久久精品在这里| 一区二区三区欧美| 精品一区二区在线视频| 91免费看视频| 欧美v亚洲v综合ⅴ国产v| 中文字幕一区二区三| 日韩黄色免费电影| 国产99久久久精品| 欧美日韩国产色站一区二区三区| 精品精品欲导航| 亚洲精品伦理在线| 国产一区二区三区在线观看免费视频 | 亚洲第一综合色| 国产精品18久久久久| 欧美日韩一级二级| 欧美国产激情二区三区| 免费看欧美美女黄的网站| 91麻豆自制传媒国产之光| 欧美电影免费观看高清完整版在线 | 国产综合色精品一区二区三区| 欧洲中文字幕精品| 国产欧美日韩中文久久| 美女视频网站久久| 在线观看亚洲专区| 中文字幕精品一区二区精品绿巨人| 亚洲成人av一区二区| 不卡的电影网站| 26uuu成人网一区二区三区| 亚洲国产一区二区三区| av亚洲精华国产精华精华| 精品久久久久久久一区二区蜜臀| 午夜成人免费视频| 91国偷自产一区二区三区成为亚洲经典 | 亚洲国产精品一区二区久久恐怖片| 日本一区二区久久| 在线观看免费视频综合| 中文字幕一区二区三区在线观看| 麻豆精品久久久| 中文字幕精品三区| 国产ts人妖一区二区| 亚洲欧洲色图综合| 欧美日本不卡视频| 亚洲伦在线观看| 91精品婷婷国产综合久久竹菊| 男人的j进女人的j一区| 亚洲午夜电影在线观看| www.色综合.com| 久久久久国产精品麻豆 | 亚洲尤物在线视频观看| av在线不卡网| 国产婷婷色一区二区三区四区| 国产综合成人久久大片91| 欧美xxxxxxxxx| 精品一区二区三区久久久| 精品人在线二区三区| 久久成人久久鬼色| 日韩视频不卡中文| 久久99久久久久久久久久久| 欧美大片在线观看| 国内精品久久久久影院色| 国产亚洲精品精华液| 成人国产精品免费观看| 国产精品色哟哟| 91蝌蚪国产九色| 一区二区视频免费在线观看| 欧美手机在线视频| 日本91福利区| 欧美精品一区二区三区四区| 极品销魂美女一区二区三区| 久久九九久精品国产免费直播| 成人免费毛片嘿嘿连载视频| 亚洲色图清纯唯美| 欧美色图片你懂的| 日本欧美在线看| 久久婷婷久久一区二区三区| 成人午夜看片网址| 亚洲乱码国产乱码精品精98午夜| 欧美三级日韩三级| 麻豆国产一区二区| 国产拍欧美日韩视频二区| 色婷婷综合久久久久中文一区二区 | 26uuu另类欧美亚洲曰本| 国产精品影音先锋| 亚洲免费观看高清在线观看| 欧美福利电影网| 国产盗摄精品一区二区三区在线| 亚洲欧美成aⅴ人在线观看| 在线不卡一区二区| 国产成人h网站|