code: func pemToX509Certs(pemCerts []byte) ([]*x509.Certificate, []string, error) {
  
  	//it's possible that multiple certs are encoded
  	certs := []*x509.Certificate{}
  	subjects := []string{}
  	for len(pemCerts) > 0 {
  		var block *pem.Block
  		block, pemCerts = pem.Decode(pemCerts)
  		if block == nil {
  			break
  		}
  		/** TODO: check why msp does not add type to PEM header
  		if block.Type != "CERTIFICATE" || len(block.Headers) != 0 {
  			continue
  		}
  		*/
  
  		cert, err := x509.ParseCertificate(block.Bytes)
  		if err != nil {
  			return nil, subjects, err
  		} else {
  			certs = append(certs, cert)
  			//extract and append the subject
  			subjects = append(subjects, string(cert.RawSubject))
  		}
  	}
  	return certs, subjects, nil
  }
docs: //utility function to parse PEM-encoded certs