code: func GetPublicKeyFromCert(cert []byte, cs core.CryptoSuite) (core.Key, error) {
  
  	dcert, _ := pem.Decode(cert)
  	if dcert == nil {
  		return nil, errors.Errorf("Unable to decode cert bytes [%v]", cert)
  	}
  
  	x509Cert, err := x509.ParseCertificate(dcert.Bytes)
  	if err != nil {
  		return nil, errors.Errorf("Unable to parse cert from decoded bytes: %s", err)
  	}
  
  	// get the public key in the right format
  	key, err := cs.KeyImport(x509Cert, factory.GetX509PublicKeyImportOpts(true))
  	if err != nil {
  		return nil, errors.WithMessage(err, "Failed to import certificate's public key")
  	}
  
  	return key, nil
  }
docs: // GetPublicKeyFromCert will return public key the from cert