Skip to content
Newer
Older
100644 43 lines (36 sloc) 2.13 KB
e2055e8 initial import
jon.r.crosby authored
1 //
2 // OAHMAC_SHA1SignatureProviderTest.m
3 //
4 // Created by Jon Crosby on 10/19/07.
5 // Copyright 2007 Kaboomerang LLC. All rights reserved.
6 //
7 // Permission is hereby granted, free of charge, to any person obtaining a copy
8 // of this software and associated documentation files (the "Software"), to deal
9 // in the Software without restriction, including without limitation the rights
10 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 // copies of the Software, and to permit persons to whom the Software is
12 // furnished to do so, subject to the following conditions:
13 //
14 // The above copyright notice and this permission notice shall be included in
15 // all copies or substantial portions of the Software.
16 //
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 // THE SOFTWARE.
24
25
26 #import "OAHMAC_SHA1SignatureProviderTest.h"
27
28
29 @implementation OAHMAC_SHA1SignatureProviderTest
30
31 - (void)testSignClearText {
32 OAHMAC_SHA1SignatureProvider *provider = [[OAHMAC_SHA1SignatureProvider alloc] init];
33 STAssertEqualObjects([provider signClearText:@"simon says" withSecret:@"abcedfg123456789"],
34 @"vyeIZc3+tF6F3i95IEV+AJCWBYQ=",
35 NULL);
36 STAssertEqualObjects([provider signClearText:@"GET&http%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal&kd94hf93k423kf44&pfkkdhi9sl3r4s00"
37 withSecret:@"kd94hf93k423kf44&pfkkdhi9sl3r4s00"],
38 @"Gcg/323lvAsQ707p+y41y14qWfY=",
39 NULL);
40 }
41
42 @end
Something went wrong with that request. Please try again.