2 * Copyright (c) 2020 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 #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>
37 NS_ASSUME_NONNULL_BEGIN
39 //! Project version number for OctagonTrust.
40 FOUNDATION_EXPORT
double OctagonTrustVersionNumber
;
42 //! Project version string for OctagonTrust.
43 FOUNDATION_EXPORT
const unsigned char OctagonTrustVersionString
[];
45 extern NSString
* OTCKContainerName
;
47 @interface
OTConfigurationContext(Framework
)
48 @
property (nonatomic
, copy
, nullable
) OTEscrowAuthenticationInformation
* escrowAuth
;
51 @interface
OTClique(Framework
)
54 * @abstract Fetch recommended iCDP escrow records
56 * @param data, context containing parameters to setup OTClique
57 * @param error, error gets filled if something goes horribly wrong
59 * @return array of escrow records that can get a device back into trust
61 + (NSArray
<OTEscrowRecord
*>* _Nullable
)fetchEscrowRecords
:(OTConfigurationContext
*)data error
:(NSError
**)error
;
65 * @abstract Fetch all iCDP escrow records
67 * @param data, context containing parameters to setup OTClique
68 * @param error, error gets filled if something goes horribly wrong
70 * @return array of all escrow records (viable and legacy)
72 + (NSArray
<OTEscrowRecord
*>* _Nullable
)fetchAllEscrowRecords
:(OTConfigurationContext
*)data error
:(NSError
**)error
;
75 * @abstract Perform escrow recovery of a particular record (not silent)
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
82 * @return clique, returns a new clique instance
84 + (instancetype _Nullable
)performEscrowRecovery
:(OTConfigurationContext
*)data
85 cdpContext
:(OTICDPRecordContext
*)cdpContext
86 escrowRecord
:(OTEscrowRecord
*)escrowRecord
87 error
:(NSError
**)error
;
90 * @abstract Perform a silent escrow recovery
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
98 + (instancetype _Nullable
)performSilentEscrowRecovery
:(OTConfigurationContext
*)data
99 cdpContext
:(OTICDPRecordContext
*)cdpContext
100 allRecords
:(NSArray
<OTEscrowRecord
*>*)allRecords
101 error
:(NSError
**)error
;
103 + (BOOL
) invalidateEscrowCache
:(OTConfigurationContext
*)data error
:(NSError
**)error
;
107 NS_ASSUME_NONNULL_END