adding certificate chain implementation