Added getPublicKey function in server