]> git.saurik.com Git - apple/security.git/blob - certificates/ota_cert_tool/SecuritydAssertHelper/SecuritydAssertHelper.m
Security-57031.30.12.tar.gz
[apple/security.git] / certificates / ota_cert_tool / SecuritydAssertHelper / SecuritydAssertHelper.m
1 //
2 // SecuritydAssertHelper.m
3 // SecuritydAssertHelper
4 //
5 // Copyright (c) 2012-2013 Apple Inc. All Rights Reserved.
6 //
7
8 #import <Foundation/Foundation.h>
9 #include <unistd.h>
10 #import <MobileAsset/MobileAsset.h>
11
12 static NSString * const PKITrustDataAssetType = @"com.apple.MobileAsset.PKITrustServices.PKITrustData";
13
14
15 int main (int argc, const char * argv[])
16 {
17 @autoreleasepool
18 {
19 ASAssetQuery* assetQuery = [[ASAssetQuery alloc] initWithAssetType:PKITrustDataAssetType];
20
21 if (nil == assetQuery)
22 {
23 NSLog(@"Could not create an ASAssetQuery object");
24 exit(EXIT_FAILURE);
25 }
26
27 NSError* error = nil;
28 NSArray* foundAssets = nil;
29
30 foundAssets = [assetQuery runQueryAndReturnError:&error];
31 if (nil == foundAssets)
32 {
33 NSLog(@"running assetQuery fails: %@", [error localizedDescription]);
34 exit(EXIT_FAILURE);
35 }
36
37 return 0;
38 }
39 }