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

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

?? kerberosauthenticationclient.java

?? asdd deanhasd ris djfdhawnrkjvas awknskidasd
?? JAVA
字號(hào):
/*
  Simple Implementation of Kerberos protocol v5
  Copyright (C) 2003 Thia Yeo Ching (tycordinal@yahoo.co.uk)

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

*/
package SimpleKerberos.guitool;

import SimpleKerberos.*;
import SimpleKerberos.tool.ICryptor;
import SimpleKerberos.tool.HashedNormalCryptor;
import SimpleKerberos.config.DefaultSettings;

import javax.swing.*;
import javax.crypto.SealedObject;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * Author: Thia Yeo Ching, tycordinal@yahoo.co.uk
 * Date: Mar 24, 2003
 * Time: 9:22:11 PM
 * Submitted in Partial Fulfillment of the Requirements
 * for the Degree of Bachelor of Computer Engineering
 * of the Nanyang Technological University
 */
public class KerberosAuthenticationClient extends JFrame
  implements ActionListener

{
  public static final String TITLE = "Kerberos Authentication Client";
  private static final String KERBEROS_HOST_NAME = "Kerberos Host Name";
  private static final String EMPTY = "";
  private static final String ELLIPSIS = "...";
  private static final String EXCEPTION = "Exception:";
  private static final String SUCCESS_LOGIN = "*** success login";
  private static final String FAILED_LOGIN = "*** failed to login: incorrect name or password";
  private static final String ENTER_HOST = "Please enter your host";
  private static final String  ENTER_PWD = "Please enter your password";
  private static final String FAILED_CONTACT_HOST = "failed to contact host ";
  private static final String CONTACT_HOST = "Contacting host ";

  public SealedObject getSoTGSTicket()
  {
    return soTGSTicket_;
  }

  public String getTgsSessionKey()
  {
    return tgsSessionKey_;
  }

  public String getClientName()
  {
    return clientName_;
  }

  private SealedObject soTGSTicket_ = null;
  private String tgsSessionKey_ = null;
  private String clientName_ = null;

  private JTextField hostText;
  private JLabel hostLabel;

  private JLabel nameLabel;
  private JLabel pwdLabel;
  private JTextField nameText;
  private JPasswordField pwdText;
  private JButton okButton;
  private StatusArea statusArea;

  private static final String OK = "OK";
  private static final String ENTER_NAME = "Please enter your name";

  public static void main(String args[])
  {
    new KerberosAuthenticationClient().setVisible(true);
  }

  public KerberosAuthenticationClient()
  {
    super(TITLE);

    hostLabel = new JLabel(KERBEROS_HOST_NAME);
    hostText = new JTextField();

    nameLabel = new JLabel("Name");
    pwdLabel = new JLabel("Password");
    nameText = new JTextField();
    pwdText = new JPasswordField();
    okButton = new JButton(OK);
    statusArea = new StatusArea();


    LayoutManager detailsLayout = new GridLayout(3, 2);
    Container detailsPane = new Container();
    detailsPane.setLayout(detailsLayout);

    detailsPane.add(hostLabel);
    detailsPane.add(hostText);
    detailsPane.add(nameLabel);
    detailsPane.add(nameText);
    detailsPane.add(pwdLabel);
    detailsPane.add(pwdText);

    LayoutManager contentLayout = new GridLayout(3, 1);
    Container contentPane = this.getContentPane();
    contentPane.setLayout(contentLayout);
    contentPane.add(detailsPane);
    contentPane.add(okButton);
    contentPane.add(statusArea);

    okButton.addActionListener(this);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.pack();

  }

  private void clearPassword()
  {
    pwdText.setText(EMPTY);
  }

  private boolean checkPassword()
  {
    if (pwdText.getPassword().length > 0)
    {
      return true;
    }

    statusArea.appendStatus(ENTER_PWD);
    return false;

  }
  private boolean checkName()
  {
    if (nameText.getText().length() > 0)
    {
      return true;
    }

    statusArea.appendStatus(ENTER_NAME);
    return false;
  }

  public void actionPerformed(ActionEvent e)
  {
    if (e.getSource() == okButton)
    {
      statusArea.clearStatus();
      if (checkDetails())
      {
        if (loginKerberos(hostText.getText(), nameText.getText(), new String(pwdText.getPassword())))
        {
          statusArea.appendStatus(SUCCESS_LOGIN);
        }
        else
        {
          statusArea.appendStatus(FAILED_LOGIN);
        }

        clearPassword();
      }
    }
  }

  private boolean checkDetails()
  {
    boolean c1 = checkPassword();
    boolean c2 = checkName();
    boolean c3 = checkHost();

    return c1 && c2 && c3;
  }

  private boolean checkHost()
  {
    if (hostText.getText().length() > 0)
    {
      return true;
    }

    statusArea.appendStatus(ENTER_HOST);
    return false;
  }

  private boolean loginKerberos(String host, String name, String pwd)
  {
    statusArea.appendStatus(CONTACT_HOST + host + ELLIPSIS);
    // assuming that the services are running
    IAuthenticationService auth = AuthenticationServiceFactory.getRemoteInstance(host);
    if (auth != null)
    {
      return do_loginKerberos(auth, name, pwd);
    }

    //clearStatus();
    statusArea.appendStatus(FAILED_CONTACT_HOST + host);
    return false;
  }



  /**
   * init soTGSTicket_, tgsSessionKey_,
   * soServiceTicket_, serviceSessionKey_
   *
   * @param auth
   * @param clientName
   * @param clientPassword
   * @return true if success login and got service ticket
   */
  private boolean do_loginKerberos(IAuthenticationService auth,
    String clientName, String clientPassword)
  {
    // Kerberos authentication

    Nounce authnounce = new Nounce();

    // C, T, n
    AuthenticationRequestMsg authreq = new AuthenticationRequestMsg(
      clientName,
      DefaultSettings.TGS_NAME, authnounce);
    assert (authreq.getClientName().equals(clientName));
    assert (authreq.getTGSName().equals(DefaultSettings.TGS_NAME));
    assert (authreq.getNounce().getValue() == authnounce.getValue());
    statusArea.appendStatus("AuthenticationRequestMsg passed");

    try
    {
      KDCServiceReplyMsg authreply = auth.authenticate(authreq);
      // decrypt sealed objects here
      // for testing, also decrypt the ticket
      ICryptor clientCryptor = new HashedNormalCryptor(clientPassword);
      ICryptor TGSCryptor = new HashedNormalCryptor(DefaultSettings.TGS_PWD);

      Challenge challenge = authreply.extractChallenge(clientCryptor);
      Ticket ticket = authreply.extractTicket(TGSCryptor);

      assert (challenge != null);
      assert (ticket != null);

      assert (challenge.getNounce().getValue() == authnounce.getValue());
      assert (challenge.getSessionKey().equals(ticket.getSessionKey()));
      assert (authreq.getClientName().equals(ticket.getClientName()));
      assert (authreq.getTGSName().equals(ticket.getServiceName()));
      ticket.checkValid();

      statusArea.appendStatus("Authentication: KDCServiceReplyMsg passed");
      statusArea.appendStatus("Dump:");
      statusArea.appendStatus(challenge.toString());
      statusArea.appendStatus(ticket.toString());

      // store for future usage
      soTGSTicket_ = authreply.getSoTicket();
      tgsSessionKey_ = challenge.getSessionKey();
      clientName_ = clientName;

      return true;

    }
    catch (Exception e)
    {
      statusArea.appendStatus(EXCEPTION + e.getMessage());
      e.printStackTrace();

    }

    return false;
  }

}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩女优毛片在线| 国产精品一区不卡| 欧美电视剧免费观看| av福利精品导航| 久久精品国产色蜜蜜麻豆| 椎名由奈av一区二区三区| 欧美成人乱码一区二区三区| kk眼镜猥琐国模调教系列一区二区 | 夜夜嗨av一区二区三区网页| 2024国产精品视频| 欧美日韩五月天| 91在线视频在线| 精品在线观看免费| 日本欧美一区二区在线观看| 日韩美女精品在线| 国产免费成人在线视频| 日韩一级高清毛片| 欧美精品一卡两卡| 在线视频一区二区三区| av不卡在线播放| 国模大尺度一区二区三区| 亚洲成人动漫在线观看| 欧美日产国产精品| 久久精品亚洲麻豆av一区二区| 91原创在线视频| 久久国产剧场电影| 亚洲成人av福利| 自拍偷拍亚洲欧美日韩| 久久久亚洲高清| 欧美日韩1234| 色又黄又爽网站www久久| 国产一区二区三区精品欧美日韩一区二区三区| 亚洲欧美韩国综合色| 亚洲国产精华液网站w| 精品国产污网站| 91精品国产综合久久精品app| 国产一区二区三区不卡在线观看| 一区二区三区日韩精品| 国产亚洲欧美日韩在线一区| 欧美午夜影院一区| 精品视频一区二区不卡| 欧美影院精品一区| 一本色道久久综合狠狠躁的推荐| 国产成人综合亚洲91猫咪| 亚洲成人av一区| 亚洲成a人在线观看| 2020国产精品自拍| 在线电影欧美成精品| 欧美天天综合网| 欧美手机在线视频| 欧美午夜一区二区三区免费大片| 91无套直看片红桃| 91国偷自产一区二区开放时间| 成人av先锋影音| av电影在线观看完整版一区二区| 成人激情图片网| 福利视频网站一区二区三区| 国产大片一区二区| 福利一区在线观看| a4yy欧美一区二区三区| 97国产精品videossex| 国产福利电影一区二区三区| 免费xxxx性欧美18vr| 紧缚奴在线一区二区三区| 精品一区二区三区欧美| 老司机午夜精品99久久| 激情综合色丁香一区二区| 黄色资源网久久资源365| 久草精品在线观看| 精品在线一区二区| 国产精品一区在线观看你懂的| 国产精品一区二区在线观看不卡| 日韩成人av影视| 麻豆国产欧美一区二区三区| 狠狠网亚洲精品| 国产精品2024| 播五月开心婷婷综合| 色婷婷综合久久久久中文 | 亚洲国产sm捆绑调教视频| 1区2区3区国产精品| 一区视频在线播放| 亚洲一区二区3| 美日韩一级片在线观看| 亚洲一本大道在线| 97久久精品人人做人人爽| 欧美午夜电影网| 精品国产一区久久| 亚洲三级在线看| 久久99久久99精品免视看婷婷 | 国产98色在线|日韩| 欧日韩精品视频| 精品国产免费一区二区三区香蕉| 欧美区一区二区三区| 日韩精品一区二区三区中文不卡| 日本一区二区三区在线观看| 怡红院av一区二区三区| 蜜桃视频一区二区| 99国产精品久久久久| 日韩午夜中文字幕| 亚洲欧洲av在线| 免费一级欧美片在线观看| 国产一本一道久久香蕉| 欧美中文字幕一区二区三区| 精品久久一区二区| 一区二区在线免费| 国产在线播放一区| 欧美日韩在线播放三区四区| wwwwxxxxx欧美| 亚洲高清不卡在线观看| 成人综合在线观看| 91麻豆精品国产91久久久久久 | 欧洲亚洲精品在线| 国产欧美日产一区| 日韩高清国产一区在线| 成人动漫av在线| 欧美成人a在线| 亚洲一区二区三区国产| 国模冰冰炮一区二区| 91国偷自产一区二区三区成为亚洲经典 | 欧美日韩不卡一区二区| 欧美国产精品中文字幕| 亚洲国产视频一区| 国产精品 日产精品 欧美精品| 制服丝袜亚洲色图| 亚洲精品视频一区| 成人精品一区二区三区中文字幕| 欧美一二三区在线观看| 亚洲国产一区二区视频| 成人99免费视频| 久久久久久免费| 久久精品国产一区二区三区免费看| 欧美日韩一级二级| 亚洲精品视频在线看| jiyouzz国产精品久久| 久久精品一区二区三区不卡牛牛| 麻豆成人久久精品二区三区红 | 成人av先锋影音| 欧美精品一区二区三区在线播放 | 91成人国产精品| 国产精品电影院| 成人免费看黄yyy456| 久久久蜜桃精品| 国内不卡的二区三区中文字幕| 欧美日韩一区视频| 亚洲成人在线网站| 欧美亚洲综合另类| 一区二区三区视频在线看| 95精品视频在线| 中文字幕一区二区5566日韩| 成人网在线播放| 中文字幕成人av| www.亚洲人| 337p粉嫩大胆噜噜噜噜噜91av| 精品一区二区三区免费| 欧美三级中文字| 婷婷六月综合网| 51久久夜色精品国产麻豆| 亚洲成av人片在www色猫咪| 欧美视频完全免费看| 亚洲午夜久久久久久久久久久| 日本高清不卡一区| 五月天中文字幕一区二区| 欧美日韩国产欧美日美国产精品| 亚洲高清中文字幕| 欧美一级片免费看| 国产精品一区专区| 亚洲欧美怡红院| 欧美视频自拍偷拍| 亚洲无线码一区二区三区| 欧美肥妇free| 日韩高清在线不卡| 精品乱人伦小说| 成人动漫视频在线| 亚洲一区二区精品久久av| 制服.丝袜.亚洲.中文.综合| 麻豆一区二区三| 国产欧美日韩视频一区二区| 99久久精品免费看| 亚洲午夜精品在线| 日韩免费观看高清完整版 | 亚洲自拍偷拍麻豆| 欧美一级黄色片| 波波电影院一区二区三区| 国产视频不卡一区| 欧美曰成人黄网| 美美哒免费高清在线观看视频一区二区 | 亚洲成人免费电影| 精品国产人成亚洲区| 97精品国产露脸对白| 蜜臀久久99精品久久久久宅男| 久久久精品国产免费观看同学| 国产精品一区专区| 一区二区三区欧美日| 欧美中文字幕一区二区三区| 精品在线观看视频| 亚洲精品视频在线看| 欧美成人一级视频| 91在线看国产| 国产一区在线不卡| 亚洲成av人片|