CURLOPT_AWS_SIGV4.3 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.haxx.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" **************************************************************************
  22. .\"
  23. .TH CURLOPT_AWS_SIGV4 3 "03 Jun 2020" "libcurl 7.72.0" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_AWS_SIGV4 \- V4 signature
  26. .SH SYNOPSIS
  27. .nf
  28. #include <curl/curl.h>
  29. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_AWS_SIGV4,
  30. char *providers_infos);
  31. .SH DESCRIPTION
  32. provides AWS V4 signature authentication on HTTPS header
  33. The provider argument is a string that is merged to some authentication
  34. parameters use by the algorithm.
  35. It's used by "Algorithm", "date", "request type", "signed headers" arguments,
  36. NOTE: This call set CURLOPT_HTTPAUTH to CURLAUTH_AWS_SIGV4.
  37. Calling CURLOPT_HTTPAUTH with CURLAUTH_AWS_SIGV4 is the same as calling
  38. this with "aws:amz" in paramater.
  39. Example with "Test:Try", when curl will do the algorithm, it will Generate:
  40. "TEST-HMAC-SHA256" for "Algorithm"
  41. "x-try-date" and "X-Try-Date" for "date"
  42. "test4_request" for "request type"
  43. "SignedHeaders=content-type;host;x-try-date" for "signed headers"
  44. If you use just "test", instead of "test:try",
  45. test will be use for every strings generated
  46. .SH DEFAULT
  47. NULL
  48. .SH PROTOCOLS
  49. HTTP
  50. .SH EXAMPLE
  51. .nf
  52. CURL *curl = curl_easy_init();
  53. struct curl_slist *list = NULL;
  54. if(curl) {
  55. curl_easy_setopt(curl, CURLOPT_URL,
  56. "https://api_type.region.example.com/uri");
  57. curl_easy_setopt(c, CURLOPT_AWS_SIGV4, "xxx:yyy");
  58. curl_easy_setopt(c, CURLOPT_USERPWD, "MY_ACCESS_KEY:MY_SECRET_KEY");
  59. curl_easy_perform(curl);
  60. }
  61. .fi
  62. .SH AVAILABILITY
  63. Added in 7.75.0
  64. .SH RETURN VALUE
  65. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  66. .SH NOTES
  67. this option overrides the other auth types you might have set in CURL_HTTPAUTH which should be highlighted as this makes this auth method special. It could probably also be mentioned that this method can't be combined with other auth types.
  68. .SH "SEE ALSO"
  69. .BR CURLOPT_HEADEROPT "(3), " CURLOPT_HTTPHEADER "(3), "