Refactor CmpResponseHelper to support intermediate certificate