Added write pub key method