コード例 #1
0
  /**
   * if any code error, exit else if any other error, show warning-error dialog, then return false
   * else return true
   */
  public boolean doJob() {
    String strMethod = "doJob()";

    // x) if pathAbsKeystore != nil, load keystore of type "JKS"
    java.security.KeyStore kstOpen = null;

    if (super._strPathAbsKst_ != null) {
      if (super._strProviderKst_ == null) {
        MySystem.s_printOutExit(this, strMethod, "nil super._strProviderKst_");
      }

      // if
      // (super._strProviderKst_.toLowerCase().compareTo(KTLAbs._f_s_strSecurityProviderSun_.toLowerCase()) != 0)
      //  MySystem.s_printOutExit(this, strMethod, "wrong value, super._strProviderKst_=" +
      // super._strProviderKst_);
      // MySystem.s_printOutWarning(this, strMethod, "should check for keystore of type JKS,
      // provider named SUN");

      // memo: keystore should be of type "JKS", provided by "SUN"
      File fleOpen = UtilJsrFile.s_getFileOpen(super._frmOwner_, super._strPathAbsKst_);

      if (fleOpen == null) {
        MySystem.s_printOutError(this, strMethod, "nil fleOpen");
        return false;
      }

      kstOpen =
          UtilKstJks.s_getKeystoreOpen(
              super._frmOwner_,
              fleOpen,
              (char[]) null // keystore's Password, not in use for verifying signed jarred file
              );

      if (kstOpen == null) {
        MySystem.s_printOutError(this, strMethod, "nil kstOpen");
        return false;
      }
    }

    super._setEnabledCursorWait_(true);

    if (!super._doJob_(kstOpen)) {
      super._setEnabledCursorWait_(false);
      MySystem.s_printOutError(this, strMethod, "failed");
      return false;
    }

    super._setEnabledCursorWait_(false);

    // ----
    return true;
  }
コード例 #2
0
  /**
   * if any error in code, exiting in case of trbrl: open up a warning dialog, and return false;
   *
   * <p>algo: . get fileOpen keystore . open keystore . fill in table entries . show dialog keystore
   * . enter new alias for trusted certificate entry candidate . create new tcr from crt file .
   * assign new entry to open keystore . save keystore
   */
  public boolean doJob() {
    String strMethod = "doJob()";

    if (!super.doJob()) {
      MySystem.s_printOutError(this, strMethod, "failed");
      return false;
    }

    super._setEnabledCursorWait_(true);

    // ---
    // get file keystore

    // memo: keystore should be of type "Uber", provided by "?"
    File fleOpenKst = UtilJsrFile.s_getFileOpen(super._frmOwner_, super._strPathAbsKst_);

    if (fleOpenKst == null) {
      super._setEnabledCursorWait_(false);
      MySystem.s_printOutError(this, strMethod, "nil fleOpenKst");
      return false;
    }

    // ----
    // open keystore

    if (super._chrsPasswdKst_ == null) {
      super._setEnabledCursorWait_(false);
      MySystem.s_printOutExit(this, strMethod, "nil super._chrsPasswdKst_");
    }

    KeyStore kstOpen =
        UtilKstUber.s_getKeystoreOpen(super._frmOwner_, fleOpenKst, super._chrsPasswdKst_);

    if (kstOpen == null) {
      super._setEnabledCursorWait_(false);
      MySystem.s_printOutError(this, strMethod, "nil kstOpen");
      return false;
    }

    if (!super._doJob_(fleOpenKst, kstOpen)) {
      super._setEnabledCursorWait_(false);
      MySystem.s_printOutError(this, strMethod, "failed");
      return false;
    }

    super._setEnabledCursorWait_(false);

    // ending
    return true;
  }