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.

I don't care much. The fact that we're passing a gc.C as parameter
is a reasonable indication, I think.