home *** CD-ROM | disk | FTP | other *** search
/ Popular Software (Premium Edition) / mycd.iso / INTERNET / NETSCAP4.06 / CP32E406.EXE / nav40.z / java40.jar / netscape / security / FrmCert.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-08-13  |  8.3 KB  |  286 lines

  1. package netscape.security;
  2.  
  3. import java.applet.Applet;
  4. import java.awt.Button;
  5. import java.awt.Color;
  6. import java.awt.Component;
  7. import java.awt.Container;
  8. import java.awt.Event;
  9. import java.awt.Font;
  10. import java.awt.Frame;
  11. import java.awt.Label;
  12. import java.awt.LayoutManager;
  13. import java.awt.Scrollbar;
  14. import java.net.MalformedURLException;
  15. import java.net.URL;
  16. import java.util.Vector;
  17.  
  18. class FrmCert extends Frame {
  19.    Applet applet = GlobalCtxt.getApplet();
  20.    Vector lbVec_g;
  21.    DialogInterface dlgi_g;
  22.    XYLayout hXYL;
  23.    Label lbHelpUrl;
  24.    ImgPanel imgPanelRoot;
  25.    Button btnCertHelp;
  26.    Button btnCertClose;
  27.    ImgPanel imgPnlTop;
  28.    Label lbCertHead;
  29.    ImgPanel imgPnlCert;
  30.    Label lbCertExpire;
  31.    Label lbCertImgUrl;
  32.    Label lbCertSerNum;
  33.    Label lbCertImgBottom;
  34.    Label lbCertImgTop;
  35.    Label lbCertImgLeft;
  36.    Label lbCertImgRight;
  37.    Label lbCertImgBotLeft;
  38.    Label lbCertImgTopLeft;
  39.    Label lbCertImgBotRight;
  40.    Label lbCertImgTopRight;
  41.    Label lbCertNATitle;
  42.    Label lbCertIBTitle;
  43.    Label lbCertFPrint;
  44.    ImgPanel imgPnlNAddr;
  45.    Scrollbar sbCertNAddr;
  46.    Label lbCertNAddr;
  47.    ImgPanel imgPnlCertIssuer;
  48.    Scrollbar sbCertIssuer;
  49.    Label lbCertIssuer;
  50.  
  51.    void btnClose_Clicked(Event var1) {
  52.       ((Component)this).hide();
  53.    }
  54.  
  55.    void btnHelp_Clicked(Event var1) {
  56.       try {
  57.          String var2 = this.lbHelpUrl.getText();
  58.          if (this.applet.getCodeBase() != null) {
  59.             var2 = this.applet.getCodeBase().toString() + this.lbHelpUrl.getText();
  60.          }
  61.  
  62.          this.applet.getAppletContext().showDocument(new URL(var2), new String("_blank"));
  63.       } catch (MalformedURLException var3) {
  64.       }
  65.    }
  66.  
  67.    FrmCert(DialogInterface var1) {
  68.       this.dlgi_g = var1;
  69.       ((Container)this).setLayout((LayoutManager)null);
  70.       ((Frame)this).addNotify();
  71.       ((Component)this).resize(((Container)this).insets().left + ((Container)this).insets().right + 570, ((Container)this).insets().top + ((Container)this).insets().bottom + 417);
  72.       ((Component)this).setBackground(new Color(12632256));
  73.       this.lbHelpUrl = new Label("help.html");
  74.       this.lbHelpUrl.hide();
  75.       this.lbHelpUrl.reshape(((Container)this).insets().left + 348, ((Container)this).insets().top + 348, 65, 18);
  76.       ((Container)this).add(this.lbHelpUrl);
  77.       this.imgPanelRoot = new ImgPanel();
  78.       this.imgPanelRoot.setLayout((LayoutManager)null);
  79.       this.imgPanelRoot.reshape(((Container)this).insets().left + 3, ((Container)this).insets().top + 2, 564, 411);
  80.       ((Container)this).add(this.imgPanelRoot);
  81.       this.btnCertHelp = new Button("Help");
  82.       this.btnCertHelp.reshape(296, 382, 70, 24);
  83.       this.btnCertHelp.setFont(new Font("TimesRoman", 0, 12));
  84.       this.imgPanelRoot.add(this.btnCertHelp);
  85.       this.btnCertClose = new Button("Close this dialog");
  86.       this.btnCertClose.reshape(200, 381, 70, 24);
  87.       this.btnCertClose.setFont(new Font("TimesRoman", 0, 12));
  88.       this.imgPanelRoot.add(this.btnCertClose);
  89.       this.imgPnlTop = new ImgPanel();
  90.       this.imgPnlTop.setLayout((LayoutManager)null);
  91.       this.imgPnlTop.reshape(12, 5, 535, 60);
  92.       this.imgPanelRoot.add(this.imgPnlTop);
  93.       this.lbCertHead = new Label("<b> The java </b> <i> applet </i>  was <33> digitally </33>  <12> signed </12>with the following certificate. The certificate <i> proves </i> who the applet is  from. <b> (Testing  multi-font wrapped text) </b>");
  94.       this.lbCertHead.hide();
  95.       this.lbCertHead.reshape(12, 0, 513, 60);
  96.       this.lbCertHead.setFont(new Font("TimesRoman", 0, 16));
  97.       this.imgPnlTop.add(this.lbCertHead);
  98.       this.imgPnlCert = new ImgPanel();
  99.       this.imgPnlCert.setLayout((LayoutManager)null);
  100.       this.imgPnlCert.reshape(12, 70, 535, 306);
  101.       this.imgPnlCert.setBackground(new Color(16777164));
  102.       this.imgPanelRoot.add(this.imgPnlCert);
  103.       this.lbCertExpire = new Label("<b> This Certificate expires October 1998 </b>");
  104.       this.lbCertExpire.hide();
  105.       this.lbCertExpire.reshape(117, 246, 375, 33);
  106.       this.lbCertExpire.setFont(new Font("TimesRoman", 1, 18));
  107.       this.imgPnlCert.add(this.lbCertExpire);
  108.       this.lbCertImgUrl = new Label("<img> <tile> cert.gif");
  109.       this.lbCertImgUrl.hide();
  110.       this.lbCertImgUrl.reshape(440, 266, 88, 23);
  111.       this.imgPnlCert.add(this.lbCertImgUrl);
  112.       this.lbCertImgUrl.disable();
  113.       this.lbCertSerNum = new Label("<b> Serial Number </b> :02:78:00:03:6B:00:01:02:03:04:05:06");
  114.       this.lbCertSerNum.hide();
  115.       this.lbCertSerNum.reshape(33, 186, 467, 34);
  116.       this.lbCertSerNum.setFont(new Font("TimesRoman", 0, 16));
  117.       this.imgPnlCert.add(this.lbCertSerNum);
  118.       this.lbCertImgBottom = new Label("<img> <trows=1> bottom.gif");
  119.       this.lbCertImgBottom.hide();
  120.       this.lbCertImgBottom.reshape(33, 273, 466, 30);
  121.       this.imgPnlCert.add(this.lbCertImgBottom);
  122.       this.lbCertImgTop = new Label("<img> <trows=1> top.gif");
  123.       this.lbCertImgTop.hide();
  124.       this.lbCertImgTop.reshape(33, 3, 466, 30);
  125.       this.imgPnlCert.add(this.lbCertImgTop);
  126.       this.lbCertImgLeft = new Label("<img> <tcols=1> left.gif");
  127.       this.lbCertImgLeft.hide();
  128.       this.lbCertImgLeft.reshape(3, 31, 30, 242);
  129.       this.imgPnlCert.add(this.lbCertImgLeft);
  130.       this.lbCertImgRight = new Label("<img> <tcols=1> right.gif");
  131.       this.lbCertImgRight.hide();
  132.       this.lbCertImgRight.reshape(499, 31, 30, 242);
  133.       this.imgPnlCert.add(this.lbCertImgRight);
  134.       this.lbCertImgBotLeft = new Label("<img> bottomleft.gif");
  135.       this.lbCertImgBotLeft.hide();
  136.       this.lbCertImgBotLeft.reshape(3, 273, 30, 30);
  137.       this.imgPnlCert.add(this.lbCertImgBotLeft);
  138.       this.lbCertImgTopLeft = new Label("<img> topleft.gif");
  139.       this.lbCertImgTopLeft.hide();
  140.       this.lbCertImgTopLeft.reshape(3, 3, 30, 30);
  141.       this.imgPnlCert.add(this.lbCertImgTopLeft);
  142.       this.lbCertImgBotRight = new Label("<img> bottomright.gif");
  143.       this.lbCertImgBotRight.hide();
  144.       this.lbCertImgBotRight.reshape(499, 273, 30, 30);
  145.       this.imgPnlCert.add(this.lbCertImgBotRight);
  146.       this.lbCertImgTopRight = new Label("<img> topright.gif");
  147.       this.lbCertImgTopRight.hide();
  148.       this.lbCertImgTopRight.reshape(499, 3, 30, 30);
  149.       this.imgPnlCert.add(this.lbCertImgTopRight);
  150.       this.lbCertNATitle = new Label("<b> This Certificate belongs to:  </b>");
  151.       this.lbCertNATitle.hide();
  152.       this.lbCertNATitle.reshape(33, 39, 233, 24);
  153.       this.lbCertNATitle.setFont(new Font("TimesRoman", 0, 16));
  154.       this.lbCertNATitle.setBackground(new Color(16777164));
  155.       this.imgPnlCert.add(this.lbCertNATitle);
  156.       this.lbCertIBTitle = new Label("<b> This Certificate was issued by: </b>");
  157.       this.lbCertIBTitle.hide();
  158.       this.lbCertIBTitle.reshape(266, 38, 233, 24);
  159.       this.lbCertIBTitle.setFont(new Font("TimesRoman", 0, 16));
  160.       this.imgPnlCert.add(this.lbCertIBTitle);
  161.       this.lbCertFPrint = new Label("<b> Certificate fingerprint: </b> 71:E380:12:F8::70:A8:30:24:2F:E6:DE-12:A9:0F");
  162.       this.lbCertFPrint.hide();
  163.       this.lbCertFPrint.reshape(33, 217, 467, 36);
  164.       this.lbCertFPrint.setFont(new Font("TimesRoman", 0, 16));
  165.       this.imgPnlCert.add(this.lbCertFPrint);
  166.       this.imgPnlNAddr = new ImgPanel();
  167.       this.imgPnlNAddr.setLayout((LayoutManager)null);
  168.       this.imgPnlNAddr.reshape(33, 68, 232, 112);
  169.       this.imgPnlCert.add(this.imgPnlNAddr);
  170.       this.sbCertNAddr = new Scrollbar(1);
  171.       this.sbCertNAddr.reshape(216, 3, 14, 105);
  172.       this.sbCertNAddr.setBackground(new Color(12632256));
  173.       this.imgPnlNAddr.add(this.sbCertNAddr);
  174.       this.lbCertNAddr = new Label("<BW> XYZ Inc, <BR> XYZ <BR> Software New York, <BR> New York, USA <BR> This is a very long <BR>  string to <BR> test how <BR> much the <BR>  box can take. If you see <BR>  ");
  175.       this.lbCertNAddr.hide();
  176.       this.lbCertNAddr.reshape(3, 3, 212, 105);
  177.       this.lbCertNAddr.setFont(new Font("TimesRoman", 0, 16));
  178.       this.lbCertNAddr.setForeground(new Color(0));
  179.       this.imgPnlNAddr.add(this.lbCertNAddr);
  180.       this.imgPnlCertIssuer = new ImgPanel();
  181.       this.imgPnlCertIssuer.setLayout((LayoutManager)null);
  182.       this.imgPnlCertIssuer.reshape(266, 68, 232, 112);
  183.       this.imgPnlCert.add(this.imgPnlCertIssuer);
  184.       this.sbCertIssuer = new Scrollbar(1);
  185.       this.sbCertIssuer.reshape(216, 3, 14, 105);
  186.       this.sbCertIssuer.setBackground(new Color(12632256));
  187.       this.imgPnlCertIssuer.add(this.sbCertIssuer);
  188.       this.lbCertIssuer = new Label("<BW> Secure Server Certification Authority RSA Data Security, Inc. US.");
  189.       this.lbCertIssuer.hide();
  190.       this.lbCertIssuer.reshape(3, 3, 212, 105);
  191.       this.lbCertIssuer.setFont(new Font("TimesRoman", 0, 16));
  192.       this.imgPnlCertIssuer.add(this.lbCertIssuer);
  193.       ((Frame)this).setTitle("Netscape [Certificate for ]");
  194.       double var2 = (double)0.0F;
  195.       double var4 = (double)0.0F;
  196.       double var6 = (double)0.0F;
  197.       double var8 = (double)0.0F;
  198.       this.hXYL = new XYLayout(((Component)this).bounds());
  199.       ((Container)this).setLayout(this.hXYL);
  200.       this.hXYL.setHints(this.imgPanelRoot, new RszHints((double)0.0F, (double)0.0F, (double)1.0F, (double)1.0F));
  201.       this.hXYL = (XYLayout)this.imgPanelRoot.getLayout();
  202.       var6 = (double)0.0F;
  203.       var2 = (double)0.0F;
  204.       var8 = (double)1.0F;
  205.       var4 = 0.2;
  206.       this.hXYL.setHints(this.imgPnlTop, new RszHints((double)0.0F, (double)0.0F, (double)1.0F, 0.2));
  207.       double var12;
  208.       double var10005 = var12 = var2 + var4;
  209.       var4 = 0.8;
  210.       this.hXYL.setHints(this.imgPnlCert, new RszHints(var6, var10005, var8, 0.8));
  211.       var6 = (double)0.5F;
  212.       this.hXYL.setHints(this.btnCertClose, new RszHints((double)0.5F, var12 + var4, (double)0.0F, (double)0.0F, (double)1.0F, (double)0.0F, (double)0.0F, (double)0.0F, (Component)null, (Component)null, (Component)null, (Component)null));
  213.       this.hXYL.setHints(this.btnCertHelp, new RszHints(var6, var12 + var4, (double)0.0F, (double)0.0F, (double)0.0F, (double)0.0F, (double)1.0F, (double)0.0F, (Component)null, (Component)null, (Component)null, (Component)null));
  214.       this.hXYL = (XYLayout)this.imgPnlTop.getLayout();
  215.       this.hXYL.setHints(this.lbCertHead, new RszHints((double)0.0F, (double)0.0F, (double)1.0F, 0.30000000000000004));
  216.       this.hXYL = (XYLayout)this.imgPnlCert.getLayout();
  217.       var6 = (double)0.0F;
  218.       var2 = (double)0.0F;
  219.       var8 = (double)0.5F;
  220.       var4 = 0.1;
  221.       this.hXYL.setHints(this.lbCertNATitle, new RszHints((double)0.0F, (double)0.0F, (double)0.5F, 0.1));
  222.       var2 = (double)0.0F;
  223.       double var10006 = (double)1.0F - var8;
  224.       var4 = 0.1;
  225.       this.hXYL.setHints(this.lbCertIBTitle, new RszHints(var8, (double)0.0F, var10006, 0.1));
  226.       var10005 = var2 + var4;
  227.       var8 = (double)0.5F;
  228.       this.hXYL.setHints(this.imgPnlNAddr, new RszHints(var6, var10005, (double)0.5F, 0.6000000000000001));
  229.       XYLayout var10 = (XYLayout)this.imgPnlNAddr.getLayout();
  230.       var10.setHints(this.lbCertNAddr, new RszHints((double)0.0F, (double)0.0F, (double)1.0F, (double)1.0F));
  231.       var10.setHints(this.sbCertNAddr, new RszHints((double)1.0F, (double)0.0F, (double)0.0F, (double)1.0F));
  232.       double var15;
  233.       var10005 = var15 = var2 + var4;
  234.       var10006 = (double)1.0F - var8;
  235.       var4 = 0.6000000000000001;
  236.       this.hXYL.setHints(this.imgPnlCertIssuer, new RszHints(var8, var10005, var10006, 0.6000000000000001));
  237.       var10 = (XYLayout)this.imgPnlCertIssuer.getLayout();
  238.       var10.setHints(this.lbCertIssuer, new RszHints((double)0.0F, (double)0.0F, (double)1.0F, (double)1.0F));
  239.       var10.setHints(this.sbCertIssuer, new RszHints((double)1.0F, (double)0.0F, (double)0.0F, (double)1.0F));
  240.       var10005 = var2 = var15 + var4;
  241.       var4 = 0.1;
  242.       this.hXYL.setHints(this.lbCertSerNum, new RszHints(var6, var10005, (double)1.0F, 0.1));
  243.       double var17;
  244.       this.hXYL.setHints(this.lbCertFPrint, new RszHints(var6, var17 = var2 + var4, (double)1.0F, var4));
  245.       this.hXYL.setHints(this.lbCertExpire, new RszHints(var6, var17 + var4, (double)1.0F, var4));
  246.       this.hXYL.setHints(this.lbCertImgTop, new RszHints((double)0.0F, (double)0.0F, (double)1.0F, (double)0.0F));
  247.       this.hXYL.setHints(this.lbCertImgBottom, new RszHints((double)0.0F, (double)1.0F, (double)1.0F, (double)0.0F));
  248.       this.hXYL.setHints(this.lbCertImgLeft, new RszHints((double)0.0F, (double)0.0F, (double)0.0F, (double)1.0F));
  249.       this.hXYL.setHints(this.lbCertImgRight, new RszHints((double)1.0F, (double)0.0F, (double)0.0F, (double)1.0F));
  250.       this.hXYL.setHints(this.lbCertImgTopLeft, new RszHints((double)0.0F, (double)0.0F, (double)0.0F, (double)0.0F));
  251.       this.hXYL.setHints(this.lbCertImgTopRight, new RszHints((double)1.0F, (double)0.0F, (double)0.0F, (double)0.0F));
  252.       this.hXYL.setHints(this.lbCertImgBotLeft, new RszHints((double)0.0F, (double)1.0F, (double)0.0F, (double)0.0F));
  253.       this.hXYL.setHints(this.lbCertImgBotRight, new RszHints((double)1.0F, (double)1.0F, (double)0.0F, (double)0.0F));
  254.       if (GlobalCtxt.rszFnSz_g) {
  255.          ((Frame)this).setResizable(true);
  256.       } else {
  257.          ((Frame)this).setResizable(false);
  258.       }
  259.  
  260.       ((Container)this).validate();
  261.    }
  262.  
  263.    public synchronized void show() {
  264.       ((Component)this).move(50, 50);
  265.       super.show();
  266.    }
  267.  
  268.    public boolean handleEvent(Event var1) {
  269.       if (var1.id == 201) {
  270.          ((Component)this).hide();
  271.       }
  272.  
  273.       if (this.dlgi_g != null && this.dlgi_g.handleEvent(this, var1)) {
  274.          return true;
  275.       } else if (var1.target == this.btnCertClose && var1.id == 1001) {
  276.          this.btnClose_Clicked(var1);
  277.          return true;
  278.       } else if (var1.target == this.btnCertHelp && var1.id == 1001) {
  279.          this.btnHelp_Clicked(var1);
  280.          return true;
  281.       } else {
  282.          return super.handleEvent(var1);
  283.       }
  284.    }
  285. }
  286.