5 // Created by Ben Williamson on 7/13/18.
8 #import <Foundation/Foundation.h>
9 #import <TrustedPeers/TrustedPeers.h>
11 int main(int argc, const char * argv[])
13 NSArray<TPPolicyDocument*> *docs
15 [TPPolicyDocument policyDocumentWithVersion:1
17 @{ @"prefix": @"iPhone", @"category": @"full" },
18 @{ @"prefix": @"iPad", @"category": @"full" },
19 @{ @"prefix": @"Mac", @"category": @"full" },
20 @{ @"prefix": @"iMac", @"category": @"full" },
21 @{ @"prefix": @"AppleTV", @"category": @"tv" },
22 @{ @"prefix": @"Watch", @"category": @"watch" },
25 @"WiFi": @[ @"full", @"tv", @"watch" ],
26 @"SafariCreditCards": @[ @"full" ],
27 @"PCSEscrow": @[ @"full" ]
29 introducersByCategory:@{
30 @"full": @[ @"full" ],
31 @"tv": @[ @"full", @"tv" ],
32 @"watch": @[ @"full", @"watch" ]
36 hashAlgo:kTPHashAlgoSHA256],
37 [TPPolicyDocument policyDocumentWithVersion:2
39 @{ @"prefix": @"iCycle", @"category": @"full" }, // new
40 @{ @"prefix": @"iPhone", @"category": @"full" },
41 @{ @"prefix": @"iPad", @"category": @"full" },
42 @{ @"prefix": @"Mac", @"category": @"full" },
43 @{ @"prefix": @"iMac", @"category": @"full" },
44 @{ @"prefix": @"AppleTV", @"category": @"tv" },
45 @{ @"prefix": @"Watch", @"category": @"watch" },
48 @"WiFi": @[ @"full", @"tv", @"watch" ],
49 @"SafariCreditCards": @[ @"full" ],
50 @"PCSEscrow": @[ @"full" ]
52 introducersByCategory:@{
53 @"full": @[ @"full" ],
54 @"tv": @[ @"full", @"tv" ],
55 @"watch": @[ @"full", @"watch" ]
59 hashAlgo:kTPHashAlgoSHA256],
60 [TPPolicyDocument policyDocumentWithVersion:3
62 @{ @"prefix": @"Watch7", @"category": @"full" }, // upgraded
63 @{ @"prefix": @"iCycle", @"category": @"full" },
64 @{ @"prefix": @"iPhone", @"category": @"full" },
65 @{ @"prefix": @"iPad", @"category": @"full" },
66 @{ @"prefix": @"Mac", @"category": @"full" },
67 @{ @"prefix": @"iMac", @"category": @"full" },
68 @{ @"prefix": @"AppleTV", @"category": @"tv" },
69 @{ @"prefix": @"Watch", @"category": @"watch" },
72 @"WiFi": @[ @"full", @"tv", @"watch" ],
73 @"SafariCreditCards": @[ @"full" ],
74 @"PCSEscrow": @[ @"full" ]
76 introducersByCategory:@{
77 @"full": @[ @"full" ],
78 @"tv": @[ @"full", @"tv" ],
79 @"watch": @[ @"full", @"watch" ]
83 hashAlgo:kTPHashAlgoSHA256],
86 for (TPPolicyDocument *doc in docs) {
87 NSString *base64 = [doc.protobuf base64EncodedStringWithOptions:0];
88 printf("policyVersion: %llu,\n", doc.policyVersion);
89 printf("policyHash: \"%s\",\n", doc.policyHash.UTF8String);
90 printf("policyData: \"%s\"\n", base64.UTF8String);