can encrypt for, getpubkey refactor