forked from lorenbrichter/OAuthCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOAuthCore.h
47 lines (41 loc) · 1.53 KB
/
OAuthCore.h
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
//
// OAuthCore.h
//
// Created by Loren Brichter on 6/9/10.
// Copyright 2010 Loren Brichter. All rights reserved.
//
#import <Foundation/Foundation.h>
extern NSString *OAuthorizationHeader(NSURL *url,
NSString *method,
NSData *body,
NSString *_oAuthConsumerKey,
NSString *_oAuthConsumerSecret,
NSString *_oAuthToken,
NSString *_oAuthTokenSecret);
extern NSString *OAuthorizationHeaderWithCallback(NSURL *url,
NSString *method,
NSData *body,
NSString *_oAuthConsumerKey,
NSString *_oAuthConsumerSecret,
NSString *_oAuthToken,
NSString *_oAuthTokenSecret,
NSString *_oAuthCallback);
typedef NS_ENUM(uint8_t, OAuthCoreSignatureMethod)
{
// OAuthCoreSignatureMethod_PLAIN_TEXT, // allowed by RFC5849, but you gotta be joking, right?
// OAuthCoreSignatureMethod_RSA_SHA1, // allowed by RFC5849, but not supported here
OAuthCoreSignatureMethod_HMAC_SHA1, // allowed by RFC5849
OAuthCoreSignatureMethod_HMAC_SHA256, // non-standard, but...
OAuthCoreSignatureMethod_Default = OAuthCoreSignatureMethod_HMAC_SHA1,
};
extern NSString *OAuthHeader(
NSURL *url,
NSString *method,
NSData *body,
NSString *_oAuthConsumerKey,
NSString *_oAuthConsumerSecret,
NSString *_oAuthToken, // nullable
NSString *_oAuthTokenSecret, // nullable
NSString *_oAuthVerifier, // nullable,
NSString *_oAuthCallback, // nullable
OAuthCoreSignatureMethod sigMethod);