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

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

?? sampleazn.java

?? jdk 6.0的api文檔...很難找到哦
?? 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;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区在线电影| 久久精品国产亚洲高清剧情介绍| 欧美va亚洲va国产综合| 欧美精品aⅴ在线视频| 欧美精品免费视频| 欧美日韩色一区| 91精品国产综合久久久久久漫画 | 国产精品亚洲成人| 国产精品 日产精品 欧美精品| 日韩va亚洲va欧美va久久| 秋霞午夜鲁丝一区二区老狼| 免费av网站大全久久| 玖玖九九国产精品| 国内久久精品视频| 久久国产免费看| 国产一区亚洲一区| 成人动漫一区二区在线| 色噜噜狠狠色综合欧洲selulu| 欧美在线视频不卡| 精品国产乱码久久久久久免费| 精品日韩欧美在线| 日本一区二区久久| 亚洲高清一区二区三区| 精品一区二区三区在线播放视频| 国产一区二区免费看| 成人爱爱电影网址| 欧美日本韩国一区| 国产精品你懂的在线欣赏| 一片黄亚洲嫩模| 美腿丝袜亚洲综合| 成人高清视频在线观看| 欧美区在线观看| 久久久久久久一区| 亚洲一区在线观看网站| 国产精品一区免费视频| 91亚洲男人天堂| 日韩视频永久免费| 一区二区三区在线影院| 国产在线国偷精品免费看| 成人禁用看黄a在线| 69av一区二区三区| 成人欧美一区二区三区小说 | a级高清视频欧美日韩| 欧美精品欧美精品系列| 中文字幕中文字幕一区| 免费精品视频在线| 日本韩国欧美三级| 久久久久久久久久看片| 日日夜夜精品视频天天综合网| 成人精品视频.| 精品剧情在线观看| 亚洲高清免费观看高清完整版在线观看| 国产一区二区在线观看免费 | 99久久婷婷国产精品综合| 日韩午夜激情视频| 亚洲成精国产精品女| gogo大胆日本视频一区| 久久久影视传媒| 免费看日韩a级影片| 777a∨成人精品桃花网| 一区二区三区**美女毛片| 成人一级片在线观看| 久久久久国产精品免费免费搜索| 日本午夜一本久久久综合| 欧美色图片你懂的| 亚洲伊人伊色伊影伊综合网| 色婷婷av一区二区三区之一色屋| 国产精品视频一区二区三区不卡| 国产精品一区一区| 久久久电影一区二区三区| 极品美女销魂一区二区三区| 日韩亚洲电影在线| 蜜芽一区二区三区| 亚洲精品在线观看网站| 国模少妇一区二区三区| 久久久久综合网| 国产91精品入口| 国产精品白丝在线| 色综合久久中文综合久久97 | 久久精品亚洲麻豆av一区二区| 久久精品国产澳门| 久久久久久久久99精品| 国产一区二区福利| 国产偷国产偷精品高清尤物| 国产露脸91国语对白| 国产精品成人一区二区艾草| 91麻豆6部合集magnet| 亚洲一二三区不卡| 91麻豆精品国产91久久久久久| 日本麻豆一区二区三区视频| 日韩一区二区三区视频| 国产一区二区三区不卡在线观看 | 欧美精品电影在线播放| 美女任你摸久久| 久久久.com| 在线亚洲高清视频| 日韩精品久久久久久| 欧美tk—视频vk| 成人动漫视频在线| 日日摸夜夜添夜夜添精品视频| 日韩美女天天操| 成人黄色777网| 午夜一区二区三区在线观看| 日韩视频永久免费| av高清久久久| 三级影片在线观看欧美日韩一区二区 | 亚洲人成在线观看一区二区| 7777精品伊人久久久大香线蕉完整版| 看国产成人h片视频| 亚洲视频在线观看一区| 日韩视频免费观看高清完整版在线观看 | 日韩激情视频在线观看| 久久人人97超碰com| 在线观看视频一区| 国产一区二区三区在线观看精品| 亚洲精品高清视频在线观看| 日韩欧美激情在线| 欧美在线免费观看视频| 国产精品一品视频| 日韩中文字幕一区二区三区| 亚洲欧美中日韩| 欧美大片拔萝卜| 欧美日韩国产免费一区二区 | 日韩精品一区二区三区视频播放 | aaa亚洲精品一二三区| 免费看日韩精品| 亚洲一区二区三区不卡国产欧美 | 91精品国产丝袜白色高跟鞋| 99精品视频一区二区三区| 韩国一区二区视频| 日本怡春院一区二区| 一区二区三区四区乱视频| 国产精品无人区| 26uuu国产电影一区二区| 制服丝袜亚洲网站| 91福利资源站| 日本大香伊一区二区三区| www.日韩在线| www.欧美.com| 成人丝袜视频网| 国产成人午夜视频| 国产一区亚洲一区| 国产麻豆视频精品| 成人精品gif动图一区| 国产一区二区中文字幕| 激情综合网激情| 美女视频黄a大片欧美| 青青草原综合久久大伊人精品| 亚洲一二三区在线观看| 亚洲国产cao| 日韩精品一区第一页| 五月激情丁香一区二区三区| 亚洲国产精品久久久男人的天堂| 亚洲综合无码一区二区| 亚洲一级片在线观看| 亚洲线精品一区二区三区八戒| 亚洲一区二区欧美| 亚洲国产一二三| 偷拍日韩校园综合在线| 偷拍日韩校园综合在线| 麻豆精品久久久| 国产一区二区三区四区五区美女| 国产一区中文字幕| aaa国产一区| 欧美系列日韩一区| 日韩一区二区三区四区五区六区| 欧美一二三区在线| 国产亚洲福利社区一区| 国产精品―色哟哟| 亚洲啪啪综合av一区二区三区| 亚洲一区二区精品久久av| 丝袜美腿成人在线| 激情欧美一区二区三区在线观看| 国产成人啪午夜精品网站男同| 粉嫩高潮美女一区二区三区| 成人免费电影视频| 欧美三级电影在线看| 91精品国产综合久久久久久 | 777久久久精品| 久久久www免费人成精品| 国产精品女同互慰在线看| 亚洲一级二级三级在线免费观看| 麻豆久久久久久久| 成人av在线资源网站| 欧美日韩电影在线| 久久久久99精品国产片| 亚洲一区二区三区影院| 久久99久久99| 在线视频欧美区| 久久久久国产一区二区三区四区| 伊人色综合久久天天| 免费视频一区二区| 色综合久久天天| 久久午夜老司机| 亚洲国产日日夜夜| 国产风韵犹存在线视精品| 欧美日韩亚洲综合在线| 国产欧美综合在线| 全国精品久久少妇| 欧美三级三级三级|