00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #import <Foundation/Foundation.h>
00017 #import <CommonCrypto/CommonDigest.h>
00018 #import <CommonCrypto/CommonHMAC.h>
00019 #import <CommonCrypto/CommonCryptor.h>
00020
00021 #import "AmazonSignatureException.h"
00022
00023 #define kError_Invalid_Hash_Alg @"Invalid hash algorithm"
00024 #define kReason_Invalid_Hash_Alg @"Only SHA1 and SHA256 are supported"
00025
00027 @interface AmazonAuthUtils : NSObject {
00028
00029 }
00030
00031
00032 +(NSString*)getAuthorization:(NSString*)timestamp forBucket:(NSString*)bucket forVerb:(NSString*)verb accessKey:(NSString*)accessKey secretKey:(NSString*)secretKey;
00033 +(NSString*)getSignature:(NSString*)timestamp forBucket:(NSString*)bucket forVerb:(NSString*)httpVerb secretKey:(NSString*)secretKey;
00034
00035
00043 + (NSString *) HMACSign:(NSData *)data withKey:(NSString *)key usingAlgorithm:(CCHmacAlgorithm)algorithm;
00044
00045 @end
00046
00050 @interface NSData(WithBase64)
00051
00057 - (NSString *) base64EncodedString;
00058
00059 @end