Merge readPublicKey for V3 and V4