KS3AuthUtils.h
3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//
// KingSoftAuthUtils.h
// KS3SDK
//
// Created by JackWong on 12/9/14.
// Copyright (c) 2014 kingsoft. All rights reserved.
//
#import "KS3AuthUtils.h"
#import <Foundation/Foundation.h>
typedef enum {
KSS3_HTTPVerbGet,
KSS3_HTTPVerbPost,
KSS3_HTTPVerbPut,
KSS3_HTTPVerbDelete,
KSS3_HTTPVerbHead,
} KSS3_HTTPVerbType;
@class KS3ServiceRequest;
@class KS3Credentials;
@class KS3URLRequest;
@interface KS3AuthUtils : NSObject
+ (NSString *)KSYSignatureWithSecretKey:(NSString *)secretKey
httpVerb:(NSString *)httpVerb
contentMd5:(NSString *)strContentMd5
contentType:(NSString *)strContentType
date:(NSDate *)date
canonicalizedKssHeader:(NSString *)strHeaders
canonicalizedResource:(NSString *)strResource;
+ (NSString *)KSYSignatureWithSecretKey:(NSString *)secretKey
httpVerb:(NSString *)httpVerb
contentMd5:(NSString *)strContentMd5
contentType:(NSString *)strContentType
strDate:(NSString *)strDate
canonicalizedKssHeader:(NSString *)strHeaders
canonicalizedResource:(NSString *)strResource;
+ (NSString *)KSYAuthorizationWithAccessKey:(NSString *)accessKey
secretKey:(NSString *)secretKey
httpVerbType:(KSS3_HTTPVerbType)httpVerb
contentMd5:(NSString *)strContentMd5
contentType:(NSString *)strContentType
date:(NSDate *)date
canonicalizedKssHeader:(NSString *)strHeaders
canonicalizedResource:(NSString *)strResource;
+ (NSString *)strDateWithDate:(NSDate *)date andType:(NSString *)strType;
+ (void)signRequestV4:(KS3ServiceRequest *)serviceRequest
urlRequest:(KS3URLRequest *)urlRequest
headers:(NSMutableDictionary *)headers
payload:(NSString *)payload
credentials:(KS3Credentials *)credentials;
+ (NSString *)KSYAuthorizationWithAccessKey:(NSString *)accessKey
secretKey:(NSString *)secretKey
httpVerb:(NSString *)httpVerb
contentMd5:(NSString *)strContentMd5
contentType:(NSString *)strContentType
date:(NSDate *)date
canonicalizedKssHeader:(NSString *)strHeaders
canonicalizedResource:(NSString *)strResource;
+ (NSString *)KSYAuthorizationWithAccessKey:(NSString *)accessKey
secretKey:(NSString *)secretKey
httpVerb:(NSString *)httpVerb
contentMd5:(NSString *)strContentMd5
contentType:(NSString *)strContentType
strDate:(NSString *)strDate
canonicalizedKssHeader:(NSString *)strHeaders
canonicalizedResource:(NSString *)strResource;
@end