5 #import "keychain/SecureObjectSync/SOSAccountPriv.h"
6 #import "keychain/SecureObjectSync/SOSAccountTrust.h"
8 @implementation SOSAccountTrust
9 @synthesize cachedOctagonEncryptionKey = _cachedOctagonEncryptionKey;
10 @synthesize cachedOctagonSigningKey = _cachedOctagonSigningKey;
14 return [[SOSAccountTrust alloc]init];
19 if ((self = [super init])) {
20 self.retirees = [NSMutableSet set];
21 self.fullPeerInfo = NULL;
22 self.trustedCircle = NULL;
23 self.departureCode = kSOSDepartureReasonError;
24 self.expansion = [NSMutableDictionary dictionary];
29 -(id)initWithRetirees:(NSMutableSet*)r fpi:(SOSFullPeerInfoRef)fpi circle:(SOSCircleRef) trusted_circle
30 departureCode:(enum DepartureReason)code peerExpansion:(NSMutableDictionary*)e
33 if ((self = [super init])) {
35 self.fullPeerInfo = fpi;
36 self.trustedCircle = trusted_circle;
37 self.departureCode = code;
44 CFReleaseNull(self->fullPeerInfo);
45 CFReleaseNull(self->peerInfo);
46 CFReleaseNull(self->trustedCircle);
47 CFReleaseNull(self->_cachedOctagonSigningKey);
48 CFReleaseNull(self->_cachedOctagonEncryptionKey);
52 - (SOSPeerInfoRef) peerInfo {
53 return SOSFullPeerInfoGetPeerInfo(self.fullPeerInfo);
56 - (NSString*) peerID {
57 return (__bridge_transfer NSString*) CFRetainSafe(SOSPeerInfoGetPeerID(self.peerInfo));
60 @synthesize trustedCircle = trustedCircle;
62 - (void) setTrustedCircle:(SOSCircleRef) circle {
63 CFRetainAssign(self->trustedCircle, circle);
66 @synthesize retirees = retirees;
68 -(void) setRetirees:(NSSet *)newRetirees
70 self->retirees = newRetirees.mutableCopy;
73 @synthesize fullPeerInfo = fullPeerInfo;
75 - (void) setFullPeerInfo:(SOSFullPeerInfoRef) newIdentity {
76 CFRetainAssign(self->fullPeerInfo, newIdentity);
79 @synthesize expansion = expansion;
81 -(void)setExpansion:(NSDictionary*) newExpansion
83 self->expansion = newExpansion.mutableCopy;
86 @synthesize departureCode = departureCode;
88 -(void)setDepartureCode:(enum DepartureReason)newDepartureCode
90 self->departureCode = newDepartureCode;