add method for extracting certificates chain