package com.google.code.p.keytooliui.ktl.swing.panel;
/**
MEMO: usage:
* keytool
-genkey
...
...
...
...
-dname "cn=[Testing Object Signing Certificate], o=[John Johnson], ou=[My Products], c=[EN-FR-DE-AU-RU]"
---------------------
cn = certificate name
o = organization
ou = organizational unit
c = country (first two letters)
memo: in a batch:
CN: first & last name
OU: organizational unit
O: name of your organization
L: name of your city or locality
ST: name of your state or province
C: what is the two-letter country code for this unit
known subclasses:
. PTabUICmdKtlKstOpenCrKprDsa
. PTabUICmdKtlKstOpenCrKprRsa
**/
import com.google.code.p.keytooliui.ktl.io.*;
import com.google.code.p.keytooliui.ktl.swing.panel.PSelBtnTfdStrXlsCbxGender;
import com.google.code.p.keytooliui.ktl.util.jarsigner.*;
import com.google.code.p.keytooliui.shared.lang.*;
import com.google.code.p.keytooliui.shared.swing.panel.*;
import com.google.code.p.keytooliui.shared.swing.optionpane.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import java.awt.*;
abstract public class PTabUICmdKtlKstOpenCrKprAbs extends PTabUICmdKtlKstOpenAbs
{
// --------------------
// FINAL STATIC PRIVATE
// properties
final static private String _f_s_strDocPropValCN = "cn";
final static private String _f_s_strDocPropValOU = "ou";
final static private String _f_s_strDocPropValO = "o";
final static private String _f_s_strDocPropValL = "l";
final static private String _f_s_strDocPropValST = "st";
final static private String _f_s_strDocPropValEMAIL = "email";
final static private String _f_s_strDocPropValC = "c";
final static private String _f_s_strDocPropValT = "t";
final static private String _f_s_strDocPropValSN = "sn";
final static private String _f_s_strDocPropValSTREET = "street";
final static private String _f_s_strDocPropValBUSINESS_CATEGORY = "business_category";
final static private String _f_s_strDocPropValPOSTAL_CODE = "postal_code";
final static private String _f_s_strDocPropValDN_QUALIFIER = "dn_qualifier";
final static private String _f_s_strDocPropValPSEUDONYM = "pseudonym";
final static private String _f_s_strDocPropValDATE_OF_BIRTH = "date_of_birth";
final static private String _f_s_strDocPropValPLACE_OF_BIRTH = "place_of_birth";
final static private String _f_s_strDocPropValGENDER = "gender";
final static private String _f_s_strDocPropValCOUNTRY_OF_CITIZENSHIP = "country_of_citizenship";
final static private String _f_s_strDocPropValCOUNTRY_OF_RESIDENCE = "country_of_residence";
final static private String _f_s_strDocPropValNAME_AT_BIRTH = "name_at_birth";
final static private String _f_s_strDocPropValPOSTAL_ADDRESS = "postal_address";
final static private String _f_s_strDocPropValSURNAME = "surname";
final static private String _f_s_strDocPropValGIVENNAME = "givenname";
final static private String _f_s_strDocPropValINITIALS = "initials";
final static private String _f_s_strDocPropValGENERATION = "generation";
final static private String _f_s_strDocPropValUNIQUE_IDENTIFIER = "unique_identifier";
final static private boolean _f_s_blnReqFieldCN = true;
final static private boolean _f_s_blnReqFieldOU = false;
final static private boolean _f_s_blnReqFieldO = false;
final static private boolean _f_s_blnReqFieldL = false;
final static private boolean _f_s_blnReqFieldST = false;
final static private boolean _f_s_blnReqFieldC = true; // MEMO: required for SLL cert reply from Geotrust!
final static private boolean _f_s_blnReqFieldEMAIL = false;
final static private boolean _f_s_blnReqFieldT = false;
final static private boolean _f_s_blnReqFieldSN = false;
final static private boolean _f_s_blnReqFieldSTREET = false;
final static private boolean _f_s_blnReqFieldBUSINESS_CATEGORY = false;
final static private boolean _f_s_blnReqFieldPOSTAL_CODE = false;
final static private boolean _f_s_blnReqFieldDN_QUALIFIER = false;
final static private boolean _f_s_blnReqFieldPSEUDONYM = false;
final static private boolean _f_s_blnReqFieldDATE_OF_BIRTH = false;
final static private boolean _f_s_blnReqFieldPLACE_OF_BIRTH = false;
final static private boolean _f_s_blnReqFieldGENDER = false;
final static private boolean _f_s_blnReqFieldCOUNTRY_OF_CITIZENSHIP = false;
final static private boolean _f_s_blnReqFieldCOUNTRY_OF_RESIDENCE = false;
final static private boolean _f_s_blnReqFieldNAME_AT_BIRTH = false;
final static private boolean _f_s_blnReqFieldPOSTAL_ADDRESS = false;
final static private boolean _f_s_blnReqFieldSURNAME = false;
final static private boolean _f_s_blnReqFieldGIVENNAME = false;
final static private boolean _f_s_blnReqFieldINITIALS = false;
final static private boolean _f_s_blnReqFieldGENERATION = false;
final static private boolean _f_s_blnReqFieldUNIQUE_IDENTIFIER = false;
// ------
// PUBLIC
public void insertUpdate(DocumentEvent evtDocument)
{
String strMethod = "insertUpdate(evtDocument)";
Document doc = evtDocument.getDocument();
if (doc == null)
MySystem.s_printOutExit(this, strMethod, "nil doc");
Object objPropVal = doc.getProperty(com.google.code.p.keytooliui.shared.swing.textfield.TFAbstract.f_s_strDocPropKey);
if (objPropVal == null)
MySystem.s_printOutExit(this, strMethod, "nil objPropVal");
if (! (objPropVal instanceof String))
MySystem.s_printOutExit(this, strMethod, "! (objPropVal instanceof String)");
String strPropVal = (String) objPropVal;
if (strPropVal == null)
MySystem.s_printOutExit(this, strMethod, "nil strPropVal");
// ----
int intLength = doc.getLength();
if (intLength == 0)
MySystem.s_printOutExit(this, strMethod, "intLength == 0");
String strText = null;
try
{
strText = doc.getText(0, intLength);
}
catch(BadLocationException excBadLocation)
{
excBadLocation.printStackTrace();
MySystem.s_printOutExit(this, strMethod, "excBadLocation caught");
}
if (strPropVal.compareTo(PSelBtnTfdFileOpenKst.f_s_strDocPropVal) == 0)
{
super._strPathAbsKst_ = strText;
_updateActionButtonDataChanged_(true);
return;
}
if (strPropVal.compareTo(PSelBtnTfdPasswdXlsKstAny.f_s_strDocPropVal) == 0)
{
super._strPasswdKst_ = strText;
// _updateActionButtonDataChanged_(true);
return;
}
if (strPropVal.compareTo(PSelBtnTfdRngIntValidityKpr.f_s_strDocPropVal) == 0)
{
try
{
this._intValidityKpr_ = Integer.parseInt(strText);
}
catch(NumberFormatException excNumberFormat)
{
excNumberFormat.printStackTrace();
MySystem.s_printOutExit(this, strMethod, "excNumberFormat caught");
}
_updateActionButtonDataChanged_(true);
return;
}
// input right
if (strPropVal.compareTo(PTabUICmdKtlKstOpenCrKprAbs._f_s_strDocPropValCN) == 0)
{