code: func (pe *PluginEndorser) EndorseWithPlugin(ctx Context) (*pb.ProposalResponse, error) {
  	endorserLogger.Debug("Entering endorsement for", ctx)
  
  	if ctx.Response == nil {
  		return nil, errors.New("response is nil")
  	}
  
  	if ctx.Response.Status >= shim.ERRORTHRESHOLD {
  		return &pb.ProposalResponse{Response: ctx.Response}, nil
  	}
  
  	plugin, err := pe.getOrCreatePlugin(PluginName(ctx.PluginName), ctx.Channel)
  	if err != nil {
  		endorserLogger.Warning("Endorsement with plugin for", ctx, " failed:", err)
  		return nil, errors.Errorf("plugin with name %s could not be used: %v", ctx.PluginName, err)
  	}
  
  	prpBytes, err := proposalResponsePayloadFromContext(ctx)
  	if err != nil {
  		endorserLogger.Warning("Endorsement with plugin for", ctx, " failed:", err)
  		return nil, errors.Wrap(err, "failed assembling proposal response payload")
  	}
  
  	endorsement, prpBytes, err := plugin.Endorse(prpBytes, ctx.SignedProposal)
  	if err != nil {
  		endorserLogger.Warning("Endorsement with plugin for", ctx, " failed:", err)
  		return nil, errors.WithStack(err)
  	}
  
  	resp := &pb.ProposalResponse{
  		Version:     1,
  		Endorsement: endorsement,
  		Payload:     prpBytes,
  		Response:    ctx.Response,
  	}
  	endorserLogger.Debug("Exiting", ctx)
  	return resp, nil
  }
docs: // EndorseWithPlugin endorses the response with a plugin