2 // KCAESGCMDuplexSession.h
7 #import <Foundation/Foundation.h>
9 NS_ASSUME_NONNULL_BEGIN
11 @interface KCAESGCMDuplexSession
: NSObject
<NSSecureCoding
>
13 // Due to design constraints, this session object is the only thing serialized during piggybacking sessions.
14 // Therefore, we must add some extra data here, which is not strictly part of a AES GCM session.
15 @
property (retain
, nullable
) NSString
* pairingUUID
;
16 @property
uint64_t piggybackingVersion
;
17 @property
uint64_t epoch
;
19 - (nullable NSData
*) encrypt
: (NSData
*) data error
: (NSError
**) error
;
20 - (nullable NSData
*) decryptAndVerify
: (NSData
*) data error
: (NSError
**) error
;
22 + (nullable instancetype
) sessionAsSender
: (NSData
*) sharedSecret
23 context
: (uint64_t) context
;
24 + (nullable instancetype
) sessionAsReceiver
: (NSData
*) sharedSecret
25 context
: (uint64_t) context
;
27 - (nullable instancetype
) initAsSender
: (NSData
*) sharedSecret
28 context
: (uint64_t) context
;
29 - (nullable instancetype
) initAsReceiver
: (NSData
*) sharedSecret
30 context
: (uint64_t) context
;
31 - (nullable instancetype
) initWithSecret
: (NSData
*) sharedSecret
32 context
: (uint64_t) context
35 - (nullable instancetype
)initWithSecret
:(NSData
*)sharedSecret
36 context
:(uint64_t)context
38 pairingUUID
:(NSString
* _Nullable
)pairingUUID
39 piggybackingVersion
:(uint64_t)piggybackingVersion
41 NS_DESIGNATED_INITIALIZER
;
43 - (instancetype
) init NS_UNAVAILABLE
;
46 - (void)encodeWithCoder
:(NSCoder
*)aCoder
;
47 - (nullable instancetype
)initWithCoder
:(NSCoder
*)aDecoder
;
48 + (BOOL
)supportsSecureCoding
;