]> git.saurik.com Git - apple/security.git/blob - keychain/OctagonTrust/OctagonTrust.h
Security-59754.41.1.tar.gz
[apple/security.git] / keychain / OctagonTrust / OctagonTrust.h
1 /*
2 * Copyright (c) 2020 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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
11 * file.
12 *
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 #if __OBJC2__
25
26 #import <Foundation/Foundation.h>
27 #import <Security/OTClique.h>
28 #import <OctagonTrust/OTEscrowRecord.h>
29 #import <OctagonTrust/OTEscrowTranslation.h>
30 #import <OctagonTrust/OTEscrowAuthenticationInformation.h>
31 #import <OctagonTrust/OTICDPRecordContext.h>
32 #import <OctagonTrust/OTICDPRecordSilentContext.h>
33 #import <OctagonTrust/OTEscrowRecordMetadata.h>
34 #import <OctagonTrust/OTEscrowRecordMetadataClientMetadata.h>
35
36
37 NS_ASSUME_NONNULL_BEGIN
38
39 //! Project version number for OctagonTrust.
40 FOUNDATION_EXPORT double OctagonTrustVersionNumber;
41
42 //! Project version string for OctagonTrust.
43 FOUNDATION_EXPORT const unsigned char OctagonTrustVersionString[];
44
45 extern NSString* OTCKContainerName;
46
47 @interface OTConfigurationContext(Framework)
48 @property (nonatomic, copy, nullable) OTEscrowAuthenticationInformation* escrowAuth;
49 @end
50
51 @interface OTClique(Framework)
52
53 /* *
54 * @abstract Fetch recommended iCDP escrow records
55 *
56 * @param data, context containing parameters to setup OTClique
57 * @param error, error gets filled if something goes horribly wrong
58 *
59 * @return array of escrow records that can get a device back into trust
60 */
61 + (NSArray<OTEscrowRecord*>* _Nullable)fetchEscrowRecords:(OTConfigurationContext*)data error:(NSError**)error;
62
63
64 /* *
65 * @abstract Fetch all iCDP escrow records
66 *
67 * @param data, context containing parameters to setup OTClique
68 * @param error, error gets filled if something goes horribly wrong
69 *
70 * @return array of all escrow records (viable and legacy)
71 */
72 + (NSArray<OTEscrowRecord*>* _Nullable)fetchAllEscrowRecords:(OTConfigurationContext*)data error:(NSError**)error;
73
74 /* *
75 * @abstract Perform escrow recovery of a particular record (not silent)
76 *
77 * @param data, context containing parameters to setup OTClique
78 * @param cdpContext, context containing parameters used in recovery
79 * @param escrowRecord, the chosen escrow record to recover from
80 * @param error, error gets filled if something goes horribly wrong
81 *
82 * @return clique, returns a new clique instance
83 */
84 + (instancetype _Nullable)performEscrowRecovery:(OTConfigurationContext*)data
85 cdpContext:(OTICDPRecordContext*)cdpContext
86 escrowRecord:(OTEscrowRecord*)escrowRecord
87 error:(NSError**)error;
88
89 /* *
90 * @abstract Perform a silent escrow recovery
91 *
92 * @param data, context containing parameters to setup OTClique
93 * @param cdpContext, context containing parameters used in recovery
94 * @param allRecords, all fetched escrow records
95 * @param error, error gets filled if something goes horribly wrong
96 * @return clique, returns a new clique instance
97 */
98 + (instancetype _Nullable)performSilentEscrowRecovery:(OTConfigurationContext*)data
99 cdpContext:(OTICDPRecordContext*)cdpContext
100 allRecords:(NSArray<OTEscrowRecord*>*)allRecords
101 error:(NSError**)error;
102
103 + (BOOL) invalidateEscrowCache:(OTConfigurationContext*)data error:(NSError**)error;
104
105 @end
106
107 NS_ASSUME_NONNULL_END
108
109 #endif