protected boolean __createNewEntry__( KeyStore kstOpenTarget, PrivateKey pkyPrivateSource, Certificate[] crtsSource) { String strMethod = "__createNewEntry__(...)"; // NEW String[] strsAliasPKTC = UtilKstAbs.s_getStrsAliasPKTC(super._frmOwner_, kstOpenTarget); if (strsAliasPKTC == null) { MySystem.s_printOutExit(strMethod, "nil strsAliasPKTC"); } String[] strsAliasSK = UtilKstAbs.s_getStrsAliasSK(super._frmOwner_, kstOpenTarget); if (strsAliasSK == null) { MySystem.s_printOutExit(strMethod, "nil strsAliasPKTC"); } // -- // get arrays for dialogTableSelectKeypair // TC versus PK Boolean[] boosIsTCEntryPKTC = UtilKstAbs.s_getBoosEntryTcr(super._frmOwner_, kstOpenTarget, strsAliasPKTC); if (boosIsTCEntryPKTC == null) { MySystem.s_printOutExit(strMethod, "nil boosIsTCEntryPKTC"); } Boolean[] boosValidDatePKTC = UtilKstAbs.s_getBoosValidDatePKTC(super._frmOwner_, kstOpenTarget, strsAliasPKTC); if (boosValidDatePKTC == null) { MySystem.s_printOutExit(strMethod, "nil boosValidDatePKTC"); } Boolean[] boosSelfSignedCertPKTC = UtilKstAbs.s_getBoosSelfSigned(super._frmOwner_, kstOpenTarget, strsAliasPKTC); if (boosSelfSignedCertPKTC == null) { MySystem.s_printOutExit(strMethod, "nil boosSelfSignedCertPKTC"); } Boolean[] boosTrustedCertPKTC = UtilKstAbs.s_getBoosTrusted(super._frmOwner_, kstOpenTarget, strsAliasPKTC); if (boosTrustedCertPKTC == null) { MySystem.s_printOutExit(strMethod, "nil boosTrustedCertPKTC"); } String[] strsSizeKeyPublPKTC = UtilKstAbs.s_getStrsSizeKeyPubl(super._frmOwner_, kstOpenTarget, strsAliasPKTC); if (strsSizeKeyPublPKTC == null) { MySystem.s_printOutExit(strMethod, "nil strsSizeKeyPublPKTC"); } String[] strsTypeCertPKTC = UtilKstAbs.s_getStrsTypeCertificatePKTC(super._frmOwner_, kstOpenTarget, strsAliasPKTC); if (strsTypeCertPKTC == null) { MySystem.s_printOutExit(strMethod, "nil strsTypeCertPKTC"); } String[] strsAlgoSigCertPKTC = UtilKstAbs.s_getStrsAlgoSigCertPKTC(super._frmOwner_, kstOpenTarget, strsAliasPKTC); if (strsAlgoSigCertPKTC == null) { MySystem.s_printOutExit(strMethod, "nil strsAlgoSigCertPKTC"); } Date[] dtesLastModifiedPKTC = UtilKstAbs.s_getDtesLastModified(super._frmOwner_, kstOpenTarget, strsAliasPKTC); if (dtesLastModifiedPKTC == null) { MySystem.s_printOutExit(strMethod, "nil dtesLastModifiedPKTC"); } Date[] dtesLastModifiedSK = UtilKstAbs.s_getDtesLastModified(super._frmOwner_, kstOpenTarget, strsAliasSK); if (dtesLastModifiedSK == null) { MySystem.s_printOutExit(strMethod, "nil dtesLastModifiedPKTC"); } /* // ---- // create new alias (?& new password) // ---- // fill in table KeyPair String[] strsAliasTarget = UtilKstAbs.s_getStrsAlias( super._frmOwner_, kstOpenTarget); if (strsAliasTarget == null) { super._setEnabledCursorWait_(false); MySystem.s_printOutError(this, strMethod, "nil strsAliasTarget"); return false; } // -- Boolean[] boosEntryKpr = UtilKstAbs.s_getBoosEntryKpr( super._frmOwner_, kstOpenTarget, strsAliasTarget); if (boosEntryKpr == null) { super._setEnabledCursorWait_(false); MySystem.s_printOutError(this, strMethod, "nil boosEntryKpr"); return false; } Boolean[] boosEntryTcr = UtilKstAbs.s_getBoosEntryTcr( super._frmOwner_, kstOpenTarget, strsAliasTarget); if (boosEntryTcr == null) { super._setEnabledCursorWait_(false); MySystem.s_printOutError(this, strMethod, "nil boosEntryTcr"); return false; } Boolean[] boosSelfSignedCert = UtilKstAbs.s_getBoosSelfSigned( super._frmOwner_, kstOpenTarget, strsAliasTarget); if (boosSelfSignedCert == null) { super._setEnabledCursorWait_(false); MySystem.s_printOutError(this, strMethod, "nil boosSelfSignedCert"); return false; } Boolean[] boosTrustedCert = UtilKstAbs.s_getBoosTrusted(super._frmOwner_, kstOpenTarget, strsAliasTarget); if (boosTrustedCert == null) { super._setEnabledCursorWait_(false); MySystem.s_printOutError(this, strMethod, "nil boosTrustedCert"); return false; } String[] strsAlgoKeyPubl = UtilKstAbs.s_getStrsAlgoKeyPubl( super._frmOwner_, kstOpenTarget, strsAliasTarget); if (strsAlgoKeyPubl == null) { super._setEnabledCursorWait_(false); MySystem.s_printOutError(this, strMethod, "nil strsAlgoKeyPubl"); return false; } String[] strsSizeKeyPubl = UtilKstAbs.s_getStrsSizeKeyPubl( super._frmOwner_, kstOpenTarget, strsAliasTarget); if (strsSizeKeyPubl == null) { super._setEnabledCursorWait_(false); MySystem.s_printOutError(this, strMethod, "nil strsSizeKeyPubl"); return false; } String[] strsTypeCert = UtilKstAbs.s_getStrsTypeCertificatePKTC(super._frmOwner_, kstOpenTarget, strsAliasTarget); if (strsTypeCert == null) { super._setEnabledCursorWait_(false); MySystem.s_printOutError(this, strMethod, "nil strsTypeCert"); return false; } String[] strsAlgoSigCert = UtilKstAbs.s_getStrsAlgoSigCertPKTC(super._frmOwner_, kstOpenTarget, strsAliasTarget); if (strsAlgoSigCert == null) { super._setEnabledCursorWait_(false); MySystem.s_printOutError(this, strMethod, "nil strsAlgoSigCert"); return false; } Date[] dtesLastModified = UtilKstAbs.s_getDtesLastModified(super._frmOwner_, kstOpenTarget, strsAliasTarget); if (dtesLastModified == null) { super._setEnabledCursorWait_(false); MySystem.s_printOutError(this, strMethod, "nil dtesLastModified"); return false; }*/ // -- // assign default cursor super._setEnabledCursorWait_(false); // ---- // MEMO: overwriting alias-key not allowed // ----- // ---- // show dialog KeyPair new entry // . get aliasKpr // . get passwdKpr /*DTblEntryKprSaveAny dlgTarget = new DTblEntryKprSaveAny( super._frmOwner_, super._strTitleAppli_, kstOpenTarget, super._blnIsPasswdKprTarget_ // blnIsPassword );*/ DTblsKstViewKeySavePK dlgTarget = new DTblsKstViewKeySavePK( super._frmOwner_, kstOpenTarget, super._strPathAbsKst_, "Import private key from other keystore - step 2/2: target"); if (!dlgTarget.init()) MySystem.s_printOutExit(this, strMethod, "failed"); // if (!dlgTarget.load( // below: about PKTC (Private Key & Trusted Certificate) strsAliasPKTC, boosIsTCEntryPKTC, boosValidDatePKTC, boosSelfSignedCertPKTC, boosTrustedCertPKTC, strsSizeKeyPublPKTC, strsTypeCertPKTC, strsAlgoSigCertPKTC, dtesLastModifiedPKTC, // below: about SK (Secret Key) strsAliasSK, dtesLastModifiedSK /*strsAliasTarget, boosEntryKpr, boosEntryTcr, boosSelfSignedCert, boosTrustedCert, strsAlgoKeyPubl, strsSizeKeyPubl, strsTypeCert, strsAlgoSigCert, dtesLastModified*/ )) { MySystem.s_printOutExit(this, strMethod, "failed"); } dlgTarget.setVisible(true); char[] chrsPasswdKprTarget = new char[0]; // no password, eg, for PKCS12 // --- if (super._blnIsPasswdKprTarget_) { chrsPasswdKprTarget = dlgTarget.getPassword(); if (chrsPasswdKprTarget == null) { MySystem.s_printOutTrace(this, strMethod, "nil chrsPasswdKprTarget, aborted by user"); return false; } } String strAliasKprTarget = dlgTarget.getAlias(); if (strAliasKprTarget == null) { MySystem.s_printOutTrace(this, strMethod, "nil strAliasKprTarget, aborted by user"); return false; } // ---- // store privateKeySource & crtsSource associated with alias (?& password) in kstOpenTarget if (!UtilKstAbs.s_setKeyEntry( super._frmOwner_, kstOpenTarget, strAliasKprTarget, pkyPrivateSource, chrsPasswdKprTarget, crtsSource)) { MySystem.s_printOutError(this, strMethod, "failed"); return false; } return true; }