Merge change 4679 into donut

* changes:
  Replace the dummy code with Keystore for <keygen> support.