generatePublicKey promise and generateAppId state

* add hint to generatePublicKey method about callback parameter (it now returns a promise and does not take a callback any more as it used to)
* generateAppId should take param in favor to local state