enhance EC method to support setting curve type when generating keys and add parameter encoding option
(cherry picked from commit 24edfa9df9e6315b107b7c2d8ce0634208e8c350)