I am trying to access Amazon's Product Advertising API in my iOS application. Creating the signature seems to be the tough part. On this page:
http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/rest-signature.html
It says to "Calculate an RFC 2104-compliant HMAC with the SHA256 hash algorithm". Amazon also provides a java class to do this for you:
http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/AuthJavaSampleSig2.html
Does anybody know how I can do this in Objective-C instead? I looked into the AWS iOS SDK, but it doesn't seem to include the Product Advertising API.
Actually the AWS iOS SDK DID have a static method to handle all auth situations. Maybe you should take a glance at the AmazonAuthUtils.h :
AmazonAuthUtils.h
+(NSString *)HMACSign:(NSData *)data withKey:(NSString *)key usingAlgorithm:(CCHmacAlgorithm)algorithm; +(NSData *)sha256HMac:(NSData *)data withKey:(NSString *)key;
you can find it in the document: http://docs.amazonwebservices.com/AWSiOSSDK/latest/Classes/AmazonAuthUtils.html
1.4m articles
1.4m replys
5 comments
57.0k users