| 280 | } |
| 281 | |
| 282 | func (srv *server) getResultMap(jsonData []byte, target string) (result map[string]interface{}, err error) { |
| 283 | url := srv.getURL(target) |
| 284 | response, err := srv.post(url, jsonData) |
| 285 | if err != nil { |
| 286 | return |
| 287 | } |
| 288 | result, ok := response.Result.(map[string]interface{}) |
| 289 | if !ok { |
| 290 | err = errors.Wrap(errors.APIClientError, errors.ClientHTTPError, stderr.New("response is formatted improperly")) |
| 291 | return |
| 292 | } |
| 293 | return |
| 294 | } |
| 295 | |
| 296 | // request performs the common logic for Sign and Info, performing the actual |
| 297 | // request and returning the resultant certificate. |