A Gelfand-Naimark type theorem