Building Trustworthy Digital Repositories: Theory and Implementation