A semantic analysis of key management protocols for wireless sensor networks