]>
Commit | Line | Data |
---|---|---|
5c19dc3a A |
1 | // |
2 | // SOSAccountPriv.h | |
866f8763 | 3 | // Security |
5c19dc3a A |
4 | // |
5 | ||
866f8763 A |
6 | #ifndef SOSAccountPriv_h |
7 | #define SOSAccountPriv_h | |
5c19dc3a | 8 | |
866f8763 | 9 | #import <Foundation/Foundation.h> |
5c19dc3a A |
10 | |
11 | #include <CoreFoundation/CoreFoundation.h> | |
12 | #include <CoreFoundation/CFRuntime.h> | |
13 | #include <utilities/SecCFWrappers.h> | |
14 | #include <utilities/SecCFError.h> | |
15 | #include <utilities/SecAKSWrappers.h> | |
16 | ||
5c19dc3a A |
17 | #include <Security/SecKeyPriv.h> |
18 | ||
ecaf5866 | 19 | #include <Security/der_plist.h> |
5c19dc3a A |
20 | #include <utilities/der_plist_internal.h> |
21 | #include <corecrypto/ccder.h> | |
22 | ||
23 | #include <AssertMacros.h> | |
5c19dc3a A |
24 | |
25 | #import <notify.h> | |
26 | ||
b54c578e | 27 | #include "keychain/SecureObjectSync/SOSInternal.h" |
866f8763 | 28 | |
b54c578e A |
29 | #include "keychain/SecureObjectSync/SOSCircle.h" |
30 | #include "keychain/SecureObjectSync/SOSCircleV2.h" | |
31 | #include "keychain/SecureObjectSync/SOSRing.h" | |
32 | #include "keychain/SecureObjectSync/SOSRingUtils.h" | |
5c19dc3a | 33 | #include <Security/SecureObjectSync/SOSCloudCircle.h> |
7fb2cbd2 | 34 | #include "keychain/securityd/SOSCloudCircleServer.h" |
b54c578e A |
35 | #include "keychain/SecureObjectSync/SOSEngine.h" |
36 | #include "keychain/SecureObjectSync/SOSPeer.h" | |
37 | #include "keychain/SecureObjectSync/SOSFullPeerInfo.h" | |
5c19dc3a | 38 | #include <Security/SecureObjectSync/SOSPeerInfo.h> |
b54c578e A |
39 | |
40 | #include "keychain/SecureObjectSync/SOSPeerInfoInternal.h" | |
41 | #include "keychain/SecureObjectSync/SOSUserKeygen.h" | |
42 | #include "keychain/SecureObjectSync/SOSTransportCircle.h" | |
866f8763 | 43 | |
5c19dc3a A |
44 | #include <utilities/iCloudKeychainTrace.h> |
45 | ||
46 | #include <Security/SecItemPriv.h> | |
47 | ||
5c19dc3a | 48 | |
866f8763 A |
49 | extern const CFStringRef kSOSUnsyncedViewsKey; |
50 | extern const CFStringRef kSOSPendingEnableViewsToBeSetKey; | |
51 | extern const CFStringRef kSOSPendingDisableViewsToBeSetKey; | |
52 | extern const CFStringRef kSOSRecoveryKey; | |
53 | extern const CFStringRef kSOSAccountUUID; | |
54 | extern const CFStringRef kSOSAccountPeerNegotiationTimeouts; | |
55 | extern const CFStringRef kSOSRecoveryRing; | |
e0e0d90e | 56 | extern const CFStringRef kSOSEscrowRecord; |
79b9da22 | 57 | extern const CFStringRef kSOSAccountName; |
6b200bc3 | 58 | extern const CFStringRef kSOSTestV2Settings; |
866f8763 A |
59 | extern const CFStringRef kSOSRateLimitingCounters; |
60 | extern const CFStringRef kSOSAccountPeerLastSentTimestamp; | |
61 | extern const CFStringRef kSOSAccountRenegotiationRetryCount; | |
866f8763 | 62 | extern const CFStringRef kSOSInitialSyncTimeoutV0; |
5c19dc3a | 63 | |
866f8763 | 64 | typedef void (^SOSAccountSaveBlock)(CFDataRef flattenedAccount, CFErrorRef flattenFailError); |
5c19dc3a | 65 | |
866f8763 A |
66 | @class SOSMessageKVS; |
67 | @class CKKeyParameter; | |
68 | @class SOSAccountTrustClassic; | |
69 | @class SOSKVSCircleStorageTransport; | |
70 | @class SOSCircleStorageTransport; | |
71 | @class SOSCKCircleStorage; | |
5c19dc3a | 72 | |
ecaf5866 | 73 | @interface SOSAccount : NSObject <SOSControlProtocol> |
5c19dc3a | 74 | |
866f8763 A |
75 | @property (nonatomic, retain) NSDictionary *gestalt; |
76 | @property (nonatomic, retain) NSData *backup_key; | |
77 | @property (nonatomic, retain) NSString *deviceID; | |
6b200bc3 | 78 | |
866f8763 | 79 | @property (nonatomic, retain) SOSAccountTrustClassic *trust; |
6b200bc3 | 80 | |
866f8763 A |
81 | @property (nonatomic, retain) dispatch_queue_t queue; |
82 | @property (nonatomic, retain) dispatch_source_t user_private_timer; | |
83 | @property (nonatomic) SecKeyRef accountPrivateKey; | |
6b200bc3 | 84 | |
866f8763 | 85 | @property (nonatomic) SOSDataSourceFactoryRef factory; |
6b200bc3 | 86 | |
866f8763 A |
87 | @property (nonatomic, retain) NSData *_password_tmp; |
88 | @property (nonatomic, assign) BOOL isListeningForSync; | |
89 | @property (nonatomic, assign) int lock_notification_token; | |
90 | @property (nonatomic, retain) CKKeyParameter* key_transport; | |
b54c578e | 91 | @property (nonatomic, retain) SOSKVSCircleStorageTransport* circle_transport; |
866f8763 | 92 | @property (nonatomic, retain) SOSMessageKVS* kvs_message_transport; |
866f8763 | 93 | @property (nonatomic, retain) SOSCKCircleStorage* ck_storage; |
6b200bc3 | 94 | |
5c19dc3a | 95 | |
866f8763 A |
96 | @property (nonatomic, assign) BOOL circle_rings_retirements_need_attention; |
97 | @property (nonatomic, assign) BOOL engine_peer_state_needs_repair; | |
98 | @property (nonatomic, assign) BOOL key_interests_need_updating; | |
d64be36e A |
99 | @property (nonatomic, assign) BOOL need_backup_peers_created_after_backup_key_set; |
100 | ||
fa7225c8 | 101 | |
866f8763 | 102 | @property (nonatomic, retain) NSMutableArray *change_blocks; |
fa7225c8 | 103 | |
866f8763 | 104 | @property (nonatomic, retain) NSMutableDictionary *waitForInitialSync_blocks; |
fa7225c8 | 105 | |
d64be36e | 106 | @property (nonatomic, retain) NSData* accountKeyDerivationParameters; |
fa7225c8 | 107 | |
866f8763 A |
108 | @property (nonatomic, assign) BOOL accountKeyIsTrusted; |
109 | @property (nonatomic) SecKeyRef accountKey; | |
110 | @property (nonatomic) SecKeyRef previousAccountKey; | |
d64be36e | 111 | @property (nonatomic) SecKeyRef peerPublicKey; |
5c19dc3a | 112 | |
866f8763 | 113 | @property (copy) SOSAccountSaveBlock saveBlock; |
fa7225c8 | 114 | |
fa7225c8 | 115 | |
866f8763 A |
116 | // Identity access properties, all delegated to the trust object |
117 | @property (readonly, nonatomic) BOOL hasPeerInfo; | |
118 | @property (readonly, nonatomic) SOSPeerInfoRef peerInfo; | |
119 | @property (readonly, nonatomic) SOSFullPeerInfoRef fullPeerInfo; | |
120 | @property (readonly, nonatomic) NSString* peerID; | |
fa7225c8 | 121 | |
79b9da22 A |
122 | @property (nonatomic, assign) BOOL notifyCircleChangeOnExit; |
123 | @property (nonatomic, assign) BOOL notifyViewChangeOnExit; | |
124 | @property (nonatomic, assign) BOOL notifyBackupOnExit; | |
125 | ||
d64be36e A |
126 | @property (nonatomic, retain) NSUserDefaults* settings; |
127 | ||
128 | @property (nonatomic) SecKeyRef octagonSigningFullKeyRef; | |
129 | @property (nonatomic) SecKeyRef octagonEncryptionFullKeyRef; | |
79b9da22 | 130 | |
d64be36e | 131 | @property (nonatomic, assign) BOOL accountIsChanging; |
79b9da22 | 132 | |
5c19dc3a | 133 | |
805875f8 | 134 | -(id) init NS_UNAVAILABLE; |
866f8763 | 135 | -(id) initWithGestalt:(CFDictionaryRef)gestalt factory:(SOSDataSourceFactoryRef)factory; |
6b200bc3 | 136 | |
d64be36e | 137 | - (void)startStateMachine; |
805875f8 | 138 | |
866f8763 A |
139 | void SOSAccountAddSyncablePeerBlock(SOSAccount* a, |
140 | CFStringRef ds_name, | |
141 | SOSAccountSyncablePeersBlock changeBlock); | |
5c19dc3a | 142 | |
866f8763 | 143 | -(bool) ensureFactoryCircles; |
8a50f688 | 144 | -(void) ensureOctagonPeerKeys; |
5c19dc3a | 145 | |
866f8763 | 146 | -(void) flattenToSaveBlock; |
5c19dc3a | 147 | |
b54c578e A |
148 | -(void) ghostBustSchedule; |
149 | + (SOSAccountGhostBustingOptions) ghostBustGetRampSettings; | |
150 | - (bool) ghostBustCheckDate; | |
151 | ||
805875f8 A |
152 | #if OCTAGON |
153 | - (void)triggerBackupForPeers:(NSArray<NSString*>*)backupPeer; | |
d64be36e | 154 | - (void)triggerRingUpdate; |
805875f8 A |
155 | #endif |
156 | ||
b54c578e | 157 | |
866f8763 A |
158 | void SOSAccountSetToNew(SOSAccount* a); |
159 | ||
160 | bool SOSAccountIsMyPeerActive(SOSAccount* account, CFErrorRef* error); | |
161 | ||
162 | // MARK: In Sync checking | |
163 | typedef bool (^SOSAccountWaitForInitialSyncBlock)(SOSAccount* account); | |
5c19dc3a | 164 | |
866f8763 A |
165 | CF_RETURNS_RETAINED CFStringRef SOSAccountCallWhenInSync(SOSAccount* account, SOSAccountWaitForInitialSyncBlock syncBlock); |
166 | bool SOSAccountUnregisterCallWhenInSync(SOSAccount* account, CFStringRef id); | |
5c19dc3a | 167 | |
866f8763 A |
168 | bool SOSAccountHandleOutOfSyncUpdate(SOSAccount* account, CFSetRef oldOOSViews, CFSetRef newOOSViews); |
169 | ||
170 | void SOSAccountEnsureSyncChecking(SOSAccount* account); | |
171 | void SOSAccountCancelSyncChecking(SOSAccount* account); | |
b54c578e | 172 | void SOSAccountInitializeInitialSync(SOSAccount* account); |
866f8763 | 173 | CFMutableSetRef SOSAccountCopyOutstandingViews(SOSAccount* account); |
b54c578e | 174 | CFSetRef SOSAccountCopyEnabledViews(SOSAccount* account); |
866f8763 A |
175 | void SOSAccountNotifyEngines(SOSAccount* account); |
176 | CFMutableSetRef SOSAccountCopyOutstandingViews(SOSAccount* account); | |
177 | bool SOSAccountIsViewOutstanding(SOSAccount* account, CFStringRef view); | |
178 | CFMutableSetRef SOSAccountCopyIntersectionWithOustanding(SOSAccount* account, CFSetRef inSet); | |
179 | bool SOSAccountIntersectsWithOutstanding(SOSAccount* account, CFSetRef views); | |
180 | bool SOSAccountHasOustandingViews(SOSAccount* account); | |
181 | bool SOSAccountHasCompletedInitialSync(SOSAccount* account); | |
182 | bool SOSAccountHasCompletedRequiredBackupSync(SOSAccount* account); | |
183 | CFMutableSetRef SOSAccountCopyOutstandingViews(SOSAccount* account); | |
184 | bool SOSAccountSyncingV0(SOSAccount* account); | |
185 | ||
186 | // MARK: DER Stuff | |
5c19dc3a | 187 | |
5c19dc3a A |
188 | |
189 | size_t der_sizeof_fullpeer_or_null(SOSFullPeerInfoRef data, CFErrorRef* error); | |
190 | ||
191 | uint8_t* der_encode_fullpeer_or_null(SOSFullPeerInfoRef data, CFErrorRef* error, const uint8_t* der, uint8_t* der_end); | |
192 | ||
193 | const uint8_t* der_decode_fullpeer_or_null(CFAllocatorRef allocator, SOSFullPeerInfoRef* data, | |
866f8763 A |
194 | CFErrorRef* error, |
195 | const uint8_t* der, const uint8_t* der_end); | |
5c19dc3a A |
196 | |
197 | ||
198 | size_t der_sizeof_public_bytes(SecKeyRef publicKey, CFErrorRef* error); | |
199 | ||
200 | uint8_t* der_encode_public_bytes(SecKeyRef publicKey, CFErrorRef* error, const uint8_t* der, uint8_t* der_end); | |
201 | ||
202 | const uint8_t* der_decode_public_bytes(CFAllocatorRef allocator, CFIndex algorithmID, SecKeyRef* publicKey, CFErrorRef* error, const uint8_t* der, const uint8_t* der_end); | |
203 | ||
204 | ||
5c19dc3a | 205 | // Update |
866f8763 | 206 | -(SOSCCStatus) getCircleStatus:(CFErrorRef*) error; |
79b9da22 | 207 | -(bool) isInCircle:(CFErrorRef *)error; |
5c19dc3a | 208 | |
866f8763 | 209 | bool SOSAccountHandleCircleMessage(SOSAccount* account, |
5c19dc3a A |
210 | CFStringRef circleName, CFDataRef encodedCircleMessage, CFErrorRef *error); |
211 | ||
212 | CF_RETURNS_RETAINED | |
866f8763 | 213 | CFDictionaryRef SOSAccountHandleRetirementMessages(SOSAccount* account, CFDictionaryRef circle_retirement_messages, CFErrorRef *error); |
5c19dc3a | 214 | |
866f8763 | 215 | bool SOSAccountHandleUpdateCircle(SOSAccount* account, |
5c19dc3a A |
216 | SOSCircleRef prospective_circle, |
217 | bool writeUpdate, | |
218 | CFErrorRef *error); | |
219 | ||
5c19dc3a A |
220 | |
221 | // My Peer | |
866f8763 A |
222 | bool SOSAccountHasFullPeerInfo(SOSAccount* account, CFErrorRef* error); |
223 | ||
224 | bool SOSAccountIsMyPeerInBackupAndCurrentInView(SOSAccount* account, CFStringRef viewname); | |
225 | bool SOSAccountUpdateOurPeerInBackup(SOSAccount* account, SOSRingRef oldRing, CFErrorRef *error); | |
226 | bool SOSAccountIsPeerInBackupAndCurrentInView(SOSAccount* account, SOSPeerInfoRef testPeer, CFStringRef viewname); | |
e3d460c9 | 227 | bool SOSDeleteV0Keybag(CFErrorRef *error); |
866f8763 | 228 | bool SOSAccountUpdatePeerInfo(SOSAccount* account, CFStringRef updateDescription, CFErrorRef *error, bool (^update)(SOSFullPeerInfoRef fpi, CFErrorRef *error)); |
79b9da22 A |
229 | bool SOSAccountUpdatePeerInfoAndPush(SOSAccount* account, CFStringRef updateDescription, CFErrorRef *error, |
230 | bool (^update)(SOSPeerInfoRef pi, CFErrorRef *error)); | |
5c19dc3a A |
231 | |
232 | // Currently permitted backup rings. | |
866f8763 A |
233 | void SOSAccountForEachBackupRingName(SOSAccount* account, void (^operation)(CFStringRef value)); |
234 | void SOSAccountForEachRingName(SOSAccount* account, void (^operation)(CFStringRef value)); | |
b54c578e A |
235 | void SOSAccountForEachBackupView(SOSAccount* account, void (^operation)(const void *value)); |
236 | SOSRingRef SOSAccountCreateBackupRingForView(SOSAccount* account, CFStringRef ringBackupViewName, CFErrorRef *error); | |
237 | ||
5c19dc3a A |
238 | |
239 | // My Circle | |
866f8763 | 240 | bool SOSAccountHasCircle(SOSAccount* account, CFErrorRef* error); |
ecaf5866 | 241 | SOSCircleRef CF_RETURNS_RETAINED SOSAccountEnsureCircle(SOSAccount* a, CFStringRef name, CFErrorRef *error); |
5c19dc3a A |
242 | |
243 | void AppendCircleKeyName(CFMutableArrayRef array, CFStringRef name); | |
244 | ||
245 | CFStringRef SOSInterestListCopyDescription(CFArrayRef interests); | |
246 | ||
247 | ||
248 | // FullPeerInfos - including Cloud Identity | |
249 | SOSFullPeerInfoRef CopyCloudKeychainIdentity(SOSPeerInfoRef cloudPeer, CFErrorRef *error); | |
250 | ||
866f8763 A |
251 | bool SOSAccountIsAccountIdentity(SOSAccount* account, SOSPeerInfoRef peer_info, CFErrorRef *error); |
252 | bool SOSAccountFullPeerInfoVerify(SOSAccount* account, SecKeyRef privKey, CFErrorRef *error); | |
ecaf5866 | 253 | CF_RETURNS_RETAINED SOSPeerInfoRef GenerateNewCloudIdentityPeerInfo(CFErrorRef *error); |
5c19dc3a | 254 | |
d64be36e A |
255 | void SOSiCloudIdentityPrivateKeyForEach(void (^complete)(SecKeyRef privKey)); |
256 | ||
5c19dc3a | 257 | // Credentials |
866f8763 A |
258 | bool SOSAccountHasPublicKey(SOSAccount* account, CFErrorRef* error); |
259 | bool SOSAccountPublishCloudParameters(SOSAccount* account, CFErrorRef* error); | |
260 | bool SOSAccountRetrieveCloudParameters(SOSAccount* account, SecKeyRef *newKey, | |
5c19dc3a A |
261 | CFDataRef derparms, |
262 | CFDataRef *newParameters, CFErrorRef* error); | |
263 | ||
264 | //DSID | |
866f8763 | 265 | void SOSAccountAssertDSID(SOSAccount* account, CFStringRef dsid); |
5c19dc3a A |
266 | |
267 | // | |
268 | // Key extraction | |
269 | // | |
270 | ||
866f8763 | 271 | SecKeyRef SOSAccountCopyDeviceKey(SOSAccount* account, CFErrorRef *error); |
ecaf5866 | 272 | SecKeyRef CF_RETURNS_RETAINED GeneratePermanentFullECKey(int keySize, CFStringRef name, CFErrorRef* error); |
5c19dc3a A |
273 | |
274 | // Testing | |
866f8763 A |
275 | void SOSAccountSetLastDepartureReason(SOSAccount* account, enum DepartureReason reason); |
276 | void SOSAccountSetUserPublicTrustedForTesting(SOSAccount* account); | |
277 | ||
278 | void SOSAccountPurgeIdentity(SOSAccount*); | |
d64be36e | 279 | bool sosAccountLeaveCircle(SOSAccount* account, SOSCircleRef circle, CFErrorRef* error); |
79b9da22 | 280 | |
866f8763 A |
281 | bool SOSAccountForEachRing(SOSAccount* account, SOSRingRef (^action)(CFStringRef name, SOSRingRef ring)); |
282 | bool SOSAccountUpdateBackUp(SOSAccount* account, CFStringRef viewname, CFErrorRef *error); | |
283 | void SOSAccountEnsureRecoveryRing(SOSAccount* account); | |
866f8763 A |
284 | |
285 | bool SOSAccountEnsurePeerRegistration(SOSAccount* account, CFErrorRef *error); | |
5c19dc3a A |
286 | |
287 | extern const CFStringRef kSOSUnsyncedViewsKey; | |
fa7225c8 A |
288 | extern const CFStringRef kSOSPendingEnableViewsToBeSetKey; |
289 | extern const CFStringRef kSOSPendingDisableViewsToBeSetKey; | |
6b200bc3 | 290 | extern const CFStringRef kSOSRecoveryKey; |
5c19dc3a A |
291 | |
292 | typedef enum{ | |
e3d460c9 | 293 | kSOSTransportNone = 0, |
5c19dc3a A |
294 | kSOSTransportIDS = 1, |
295 | kSOSTransportKVS = 2, | |
296 | kSOSTransportFuture = 3, | |
297 | kSOSTransportPresent = 4 | |
298 | }TransportType; | |
299 | ||
866f8763 A |
300 | SOSPeerInfoRef SOSAccountCopyPeerWithID(SOSAccount* account, CFStringRef peerid, CFErrorRef *error); |
301 | ||
302 | bool SOSAccountSetValue(SOSAccount* account, CFStringRef key, CFTypeRef value, CFErrorRef *error); | |
303 | bool SOSAccountClearValue(SOSAccount* account, CFStringRef key, CFErrorRef *error); | |
304 | CFTypeRef SOSAccountGetValue(SOSAccount* account, CFStringRef key, CFErrorRef *error); | |
305 | ||
306 | bool SOSAccountAddEscrowToPeerInfo(SOSAccount* account, SOSFullPeerInfoRef myPeer, CFErrorRef *error); | |
866f8763 A |
307 | void SOSAccountRemoveRing(SOSAccount* a, CFStringRef ringName); |
308 | SOSRingRef SOSAccountCopyRingNamed(SOSAccount* a, CFStringRef ringName, CFErrorRef *error); | |
866f8763 A |
309 | bool SOSAccountUpdateRingFromRemote(SOSAccount* account, SOSRingRef newRing, CFErrorRef *error); |
310 | bool SOSAccountUpdateRing(SOSAccount* account, SOSRingRef newRing, CFErrorRef *error); | |
311 | bool SOSAccountRemoveBackupPeers(SOSAccount* account, CFArrayRef peerIDs, CFErrorRef *error); | |
866f8763 | 312 | bool SOSAccountUpdateNamedRing(SOSAccount* account, CFStringRef ringName, CFErrorRef *error, |
6b200bc3 A |
313 | SOSRingRef (^create)(CFStringRef ringName, CFErrorRef *error), |
314 | SOSRingRef (^copyModified)(SOSRingRef existing, CFErrorRef *error)); | |
5c19dc3a A |
315 | |
316 | // | |
317 | // MARK: Backup translation functions | |
318 | // | |
319 | ||
320 | CFStringRef SOSBackupCopyRingNameForView(CFStringRef viewName); | |
b54c578e A |
321 | bool SOSAccountUpdateBackupRing(SOSAccount* account, CFStringRef viewName, CFErrorRef *error, |
322 | SOSRingRef (^modify)(SOSRingRef existing, CFErrorRef *error)); | |
e3d460c9 A |
323 | // |
324 | // Security tool test/debug functions | |
325 | // | |
866f8763 | 326 | bool SOSAccountPostDebugScope(SOSAccount* account, CFTypeRef scope, CFErrorRef *error); |
e3d460c9 | 327 | |
866f8763 A |
328 | bool SOSAccountCheckForAlwaysOnViews(SOSAccount* account); |
329 | // UUID, no setter just getter and ensuring value. | |
330 | void SOSAccountEnsureUUID(SOSAccount* account); | |
ecaf5866 | 331 | CFStringRef CF_RETURNS_RETAINED SOSAccountCopyUUID(SOSAccount* account); |
866f8763 A |
332 | const uint8_t* der_decode_cloud_parameters(CFAllocatorRef allocator, |
333 | CFIndex algorithmID, SecKeyRef* publicKey, | |
334 | CFDataRef *parameters, | |
335 | CFErrorRef* error, | |
336 | const uint8_t* der, const uint8_t* der_end); | |
337 | ||
338 | /* | |
339 | * HSA2/piggybacking | |
340 | */ | |
341 | ||
342 | CFDataRef SOSPiggyBackBlobCopyEncodedData(SOSGenCountRef gencount, SecKeyRef pubKey, CFDataRef signature, CFErrorRef *error); | |
343 | ||
344 | #if __OBJC__ | |
345 | NSData *SOSPiggyCreateInitialSyncData(NSArray<NSData*> *identities, NSArray<NSDictionary *>* tlks); | |
346 | NSDictionary * SOSPiggyCopyInitialSyncData(const uint8_t** der, const uint8_t *der_end); | |
347 | NSArray<NSDictionary*>* SOSAccountSortTLKS(NSArray<NSDictionary*>* tlks); | |
348 | #endif | |
e3d460c9 | 349 | |
866f8763 | 350 | bool SOSAccountCleanupAllKVSKeys(SOSAccount* account, CFErrorRef* error); |
6b200bc3 | 351 | |
866f8763 A |
352 | @end |
353 | ||
354 | @interface SOSAccount (Persistence) | |
355 | ||
356 | +(instancetype) accountFromData: (NSData*) data | |
357 | factory: (SOSDataSourceFactoryRef) factory | |
358 | error: (NSError**) error; | |
359 | +(instancetype) accountFromDER: (const uint8_t**) der | |
360 | end: (const uint8_t*) der_end | |
361 | factory: (SOSDataSourceFactoryRef) factory | |
362 | error: (NSError**) error; | |
363 | ||
364 | -(NSData*) encodedData: (NSError**) error; | |
b54c578e A |
365 | |
366 | ||
866f8763 A |
367 | @end |
368 | ||
369 | #endif /* SOSAccount_h */ |