Key Management from a Security Viewpoint