ec2-signature-2.0: The Amazon EC2 style signature calculator.

Safe HaskellNone

Network.HTTP.Rest.Signature.EC2

Contents

Synopsis

Types

data QueryString Source

A query string for HTTP.

 "param1=value1&param2=value2"

Building signature

queryString :: [(ByteString, ByteString)] -> QueryStringSource

Convert a parameter list to QueryString.

>>> toString $ queryString [("param1", "value1"), ("param2", "value2")]
"param1=value1&param2=value2"

stringToSign :: Method -> Endpoint -> Path -> [(ByteString, ByteString)] -> ByteStringSource

Make a string for making signature.

>>> stringToSign "GET" "ec2.amazonaws.com" "/" [("key1", "value1"), ("key2", "value2")]
"GET\nec2.amazonaws.com\n/\nkey1=value1&key2=value2"

signature :: Method -> Endpoint -> Path -> SecretKey -> SignatureMethod -> [(ByteString, ByteString)] -> ByteStringSource

Make signature from a parameter list.