Proto read/write support on Key.

- Add constructor to read proto data.
- Add buildData to write proto data (same as KeyVersion).
- Add InvalidKeyDataException for handling read errors.