Distributed Key Management in Microgrids