Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

string_to_sign

Construct a String To Sign


Description

Construct a String to Sign from request elements

Usage

string_to_sign(
  algorithm = "AWS4-HMAC-SHA256",
  datetime,
  region,
  service,
  request_hash
)

Arguments

algorithm

A character string containing the hashing algorithm used in signing process. Should only be “AWS4-HMAC-SHA256”.

datetime

A character string containing a UTC date in the form of “YYYYMMDDTHHMMSSZ”.

region

A character string containing the AWS region for the request.

service

A character string containing the AWS service (e.g., “iam”, “host”, “ec2”).

request_hash

A character string containing the hash of the canonical request, perhaps as returned by canonical_request.

Details

This is a mostly internal function that creates a “String To Sign”, which is part of the Signature Version 4. Users probably only need to use the signature_v4_auth function to generate signatures.

Author(s)

Thomas J. Leeper <thosjleeper@gmail.com>

References

See Also

Examples

# From AWS documentation
rh <- "3511de7e95d28ecd39e9513b642aee07e54f4941150d8df8bf94b328ef7e55e2"
sts <- 
string_to_sign(datetime = "20110909T233600Z",
               region = "us-east-1",
               service = "iam",
               request_hash = rh)
identical(sts, "AWS4-HMAC-SHA256
20110909T233600Z
20110909/us-east-1/iam/aws4_request
3511de7e95d28ecd39e9513b642aee07e54f4941150d8df8bf94b328ef7e55e2")

aws.signature

Amazon Web Services Request Signatures

v0.6.0
GPL (>= 2)
Authors
Thomas J. Leeper [aut] (<https://orcid.org/0000-0003-4097-6326>), Jonathan Stott [cre, aut], Mike Kaminsky [ctb]
Initial release
2020-06-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.