rm duplicate method getpubkey