]>
git.saurik.com Git - apple/security.git/blob - Security/sec/securityd/OTATrustUtilities.h
2 * Copyright (c) 2003-2004,2006-2010,2013-2014 Apple Inc. All Rights Reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
26 #ifndef _OTATRUSTUTILITIES_H_
27 #define _OTATRUSTUTILITIES_H_ 1
29 #include <CoreFoundation/CoreFoundation.h>
30 #include <sys/types.h>
35 // Opawue type that holds the data for a specific version of the OTA PKI assets
36 typedef struct _OpaqueSecOTAPKI
*SecOTAPKIRef
;
38 // Get a reference to the current OTA PKI asset data
39 // Caller is responsible for releasing the returned SecOTAPKIRef
41 SecOTAPKIRef
SecOTAPKICopyCurrentOTAPKIRef(void);
43 // Accessor to retrieve a copy of the current black listed key.
44 // Caller is responsible for releasing the returned CFSetRef
46 CFSetRef
SecOTAPKICopyBlackListSet(SecOTAPKIRef otapkiRef
);
48 // Accessor to retrieve a copy of the current gray listed key.
49 // Caller is responsible for releasing the returned CFSetRef
51 CFSetRef
SecOTAPKICopyGrayList(SecOTAPKIRef otapkiRef
);
53 // Accessor to retrieve the array of Escrow certificates
54 // Caller is responsible for releasing the returned CFArrayRef
56 CFArrayRef
SecOTAPKICopyEscrowCertificates(uint32_t escrowRootType
, SecOTAPKIRef otapkiRef
);
58 // Accessor to retrieve the dictionary of EV Policy OIDs to Anchor digest
59 // Caller is responsible for releasing the returned CFDictionaryRef
61 CFDictionaryRef
SecOTAPKICopyEVPolicyToAnchorMapping(SecOTAPKIRef otapkiRef
);
63 // Accessor to retrieve the dictionary of anchor digest to file offest
64 // Caller is responsible for releasing the returned CFDictionaryRef
66 CFDictionaryRef
SecOTAPKICopyAnchorLookupTable(SecOTAPKIRef otapkiRef
);
68 // Accessor to retrieve the ponter to the top of the anchor certs file
69 // Caller should NOT free the returned pointer. The caller should hold
70 // a reference to the SecOTAPKIRef object until finishing processing with
71 // the returned const char*
73 const char* SecOTAPKIGetAnchorTable(SecOTAPKIRef otapkiRef
);
75 // Accessor to retrieve the current OTA PKI asset version number
77 int SecOTAPKIGetAssetVersion(SecOTAPKIRef otapkiRef
);
79 // Signal that a new OTA PKI asset version is available. This call
80 // will update the current SecOTAPKIRef to now reference the latest
83 void SecOTAPKIRefreshData(void);
85 // SPI to return the array of currently trusted Escrow certificates
87 CFArrayRef
SecOTAPKICopyCurrentEscrowCertificates(uint32_t escrowRootType
, CFErrorRef
* error
);
89 // SPI to return the current OTA PKI asset version
91 int SecOTAPKIGetCurrentAssetVersion(CFErrorRef
* error
);
93 // SPI to signal securityd to get a new set of trust data
95 int SecOTAPKISignalNewAsset(CFErrorRef
* error
);
99 #endif /* _OTATRUSTUTILITIES_H_ */