-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKBPGPKeyTest.m
More file actions
55 lines (47 loc) · 1.97 KB
/
Copy pathKBPGPKeyTest.m
File metadata and controls
55 lines (47 loc) · 1.97 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
//
// KBPGPKeyTest.m
// KBKeybaseAPI
//
// Created by Gabriel on 8/12/15.
// Copyright (c) 2015 Gabriel Handford. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <XCTest/XCTest.h>
#import <KBKeybaseAPI/KBKeybaseAPI.h>
@interface KBPGPKeyTest : XCTestCase
@end
@implementation KBPGPKeyTest
- (void)testDict {
NSError *error = nil;
NSDictionary *dict = @{
@"fingerprint": @"afb10f6a5895f5b1d67851861296617a289d5c6b",
@"flags": @(47),
@"is_locked": @NO,
@"nbits": @(4096),
@"pgp_key_id": @"1296617a289d5c6b",
@"self_signed": @YES,
@"subkeys": @[@{
@"flags": @(2),
@"nbits": @(2048),
@"pgp_key_id": @"89ae977e1bc670e5",
@"timestamp": @(1406742667),
@"type": @(1),
}, @{
@"flags": @(12),
@"nbits": @(2048),
@"pgp_key_id": @"d53374f55303d0ea",
@"timestamp": @(1406742667),
@"type": @(1),
}],
@"timestamp": @(1406742667),
@"type": @(1),
@"userids": @[@{
@"email": @"gabrielhlocal2@keybase.io",
@"is_primary": @NO,
@"username": @"keybase.io/gabrielhlocal2",
}]
};
KBPGPKey *key = [KBPGPKey PGPKeyFromDictionary:dict error:&error];
XCTAssertNotNil(key);
}
@end