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.

Perhaps we could append the error and continue in case of errors here, so that below we can avoid checking err twice.