#if OCTAGON
#import <Foundation/Foundation.h>
#import <SecurityFoundation/SFKey.h>
#import <SecurityFoundation/SFKey_Private.h>
NS_ASSUME_NONNULL_BEGIN
@protocol CKKSPeer <NSObject>
@property (readonly) NSString* peerID;
@property (nullable, readonly) SFECPublicKey* publicEncryptionKey;
@property (nullable, readonly) SFECPublicKey* publicSigningKey;
- (bool)matchesPeer:(id<CKKSPeer>)peer;
@end
@protocol CKKSRemotePeerProtocol <CKKSPeer>
- (BOOL)shouldHaveView:(NSString*)viewName;
@end
@protocol CKKSSelfPeer <CKKSPeer>
@property (readonly) SFECKeyPair* encryptionKey;
@property (readonly) SFECKeyPair* signingKey;
@end
@interface CKKSSelves : NSObject
@property id<CKKSSelfPeer> currentSelf;
@property (nullable) NSSet<id<CKKSSelfPeer>>* allSelves;
- (instancetype)initWithCurrent:(id<CKKSSelfPeer>)selfPeer allSelves:(NSSet<id<CKKSSelfPeer>>* _Nullable)allSelves;
@end
extern NSString* const CKKSSOSPeerPrefix;
@interface CKKSActualPeer : NSObject <CKKSPeer, CKKSRemotePeerProtocol, NSSecureCoding>
@property (readonly) NSString* peerID;
@property (nullable, readonly) SFECPublicKey* publicEncryptionKey;
@property (nullable, readonly) SFECPublicKey* publicSigningKey;
@property (nullable, readonly) NSSet<NSString*>* viewList;
- (instancetype)initWithPeerID:(NSString*)syncingPeerID
encryptionPublicKey:(SFECPublicKey* _Nullable)encryptionKey
signingPublicKey:(SFECPublicKey* _Nullable)signingKey
viewList:(NSSet<NSString*>* _Nullable)viewList;
@end
@protocol CKKSSOSPeerProtocol <NSObject, CKKSRemotePeerProtocol>
@end
@interface CKKSSOSPeer : NSObject <CKKSPeer, CKKSSOSPeerProtocol, CKKSRemotePeerProtocol, NSSecureCoding>
- (instancetype)initWithSOSPeerID:(NSString*)syncingPeerID
encryptionPublicKey:(SFECPublicKey* _Nullable)encryptionKey
signingPublicKey:(SFECPublicKey* _Nullable)signingKey
viewList:(NSSet<NSString*>* _Nullable)viewList;
@end
@interface CKKSSOSSelfPeer : NSObject <CKKSPeer, CKKSSOSPeerProtocol, CKKSRemotePeerProtocol, CKKSSelfPeer>
@property (readonly) NSString* peerID;
@property (nullable, readonly) NSSet<NSString*>* viewList;
@property (readonly) SFECPublicKey* publicEncryptionKey;
@property (readonly) SFECPublicKey* publicSigningKey;
@property SFECKeyPair* encryptionKey;
@property SFECKeyPair* signingKey;
- (instancetype)initWithSOSPeerID:(NSString*)syncingPeerID
encryptionKey:(SFECKeyPair*)encryptionKey
signingKey:(SFECKeyPair*)signingKey
viewList:(NSSet<NSString*>* _Nullable)viewList;
@end
NSSet<Class>* CKKSPeerClasses(void);
NS_ASSUME_NONNULL_END
#endif // OCTAGON