Add generateKey method KeyManager.