internal/legacy: implement charm-info endpoint

This requires the SHA256 hash of the content. Rather than clutter the other code,
we calculate this lazily on demand.

The fact that we're getting the correct SHA256 as a response without calling updateEntitySHA256 should give reasonable assurance of that fact, I think.
If it hadn't stored the sha256 in the document, how could it know that it
shouldn't update it?