first step of key management layer