Add key path when import secret key.
Code refine and remove extra dependency.