#if OCTAGON
#import <Foundation/Foundation.h>
#import <SecurityFoundation/SFKey.h>
@protocol CKKSPeer <NSObject>
@property (readonly) NSString* peerID;
@property (readonly) SFECPublicKey* publicEncryptionKey;
@property (readonly) SFECPublicKey* publicSigningKey;
- (bool)matchesPeer:(id<CKKSPeer>)peer;
@end
@protocol CKKSSelfPeer <CKKSPeer>
@property (readonly) SFECKeyPair* encryptionKey;
@property (readonly) SFECKeyPair* signingKey;
@end
@interface CKKSSelves : NSObject
@property id<CKKSSelfPeer> currentSelf;
@property NSSet<id<CKKSSelfPeer>>* allSelves;
- (instancetype)initWithCurrent:(id<CKKSSelfPeer>)selfPeer allSelves:(NSSet<id<CKKSSelfPeer>>*)allSelves;
@end
@protocol CKKSPeerUpdateListener;
@protocol CKKSPeerProvider <NSObject>
- (CKKSSelves*)fetchSelfPeers:(NSError* __autoreleasing *)error;
- (NSSet<id<CKKSPeer>>*)fetchTrustedPeers:(NSError* __autoreleasing *)error;
- (void)registerForPeerChangeUpdates:(id<CKKSPeerUpdateListener>)listener;
@end
@protocol CKKSPeerUpdateListener <NSObject>
- (void)selfPeerChanged;
- (void)trustedPeerSetChanged;
@end
@interface CKKSSOSPeer : NSObject <CKKSPeer>
@property (readonly) NSString* peerID;
@property (readonly) SFECPublicKey* publicEncryptionKey;
@property (readonly) SFECPublicKey* publicSigningKey;
- (instancetype)initWithSOSPeerID:(NSString*)syncingPeerID
encryptionPublicKey:(SFECPublicKey*)encryptionKey
signingPublicKey:(SFECPublicKey*)signingKey;
@end
@interface CKKSSOSSelfPeer : NSObject <CKKSPeer, CKKSSelfPeer>
@property (readonly) NSString* peerID;
@property (readonly) SFECPublicKey* publicEncryptionKey;
@property (readonly) SFECPublicKey* publicSigningKey;
@property (readonly) SFECKeyPair* encryptionKey;
@property (readonly) SFECKeyPair* signingKey;
- (instancetype)initWithSOSPeerID:(NSString*)syncingPeerID
encryptionKey:(SFECKeyPair*)encryptionKey
signingKey:(SFECKeyPair*)signingKey;
@end
#endif // OCTAGON