// // OLMSession.h // olm // // Created by Chris Ballinger on 4/8/16. // // #import #import "OLMSerializable.h" #import "OLMAccount.h" #import "OLMMessage.h" @interface OLMSession : NSObject - (instancetype) initOutboundSessionWithAccount:(OLMAccount*)account theirIdentityKey:(NSString*)theirIdentityKey theirOneTimeKey:(NSString*)theirOneTimeKey error:(NSError**)error; - (instancetype) initInboundSessionWithAccount:(OLMAccount*)account oneTimeKeyMessage:(NSString*)oneTimeKeyMessage error:(NSError**)error; - (instancetype) initInboundSessionWithAccount:(OLMAccount*)account theirIdentityKey:(NSString*)theirIdentityKey oneTimeKeyMessage:(NSString*)oneTimeKeyMessage error:(NSError**)error; - (NSString*) sessionIdentifier; - (BOOL) matchesInboundSession:(NSString*)oneTimeKeyMessage; - (BOOL) matchesInboundSessionFrom:(NSString*)theirIdentityKey oneTimeKeyMessage:(NSString *)oneTimeKeyMessage; /** UTF-8 plaintext -> base64 ciphertext */ - (OLMMessage*) encryptMessage:(NSString*)message error:(NSError**)error; /** base64 ciphertext -> UTF-8 plaintext */ - (NSString*) decryptMessage:(OLMMessage*)message error:(NSError**)error; @end