add key serialization/deserialization