olm/xcode/OLMKit/OLMSession.h

35 lines
1.1 KiB
C
Raw Normal View History

2016-04-09 02:24:41 +02:00
//
// OLMSession.h
// olm
//
// Created by Chris Ballinger on 4/8/16.
//
//
#import <Foundation/Foundation.h>
#import "OLMSerializable.h"
#import "OLMAccount.h"
2016-04-09 23:00:30 +02:00
#import "OLMMessage.h"
2016-04-09 02:24:41 +02:00
@interface OLMSession : NSObject <OLMSerializable, NSSecureCoding>
2016-04-09 02:24:41 +02:00
2016-04-09 23:00:30 +02:00
- (instancetype) initOutboundSessionWithAccount:(OLMAccount*)account theirIdentityKey:(NSString*)theirIdentityKey theirOneTimeKey:(NSString*)theirOneTimeKey;
2016-04-09 02:24:41 +02:00
2016-04-09 23:00:30 +02:00
- (instancetype) initInboundSessionWithAccount:(OLMAccount*)account oneTimeKeyMessage:(NSString*)oneTimeKeyMessage;
2016-04-09 02:24:41 +02:00
2016-04-09 23:00:30 +02:00
- (instancetype) initInboundSessionWithAccount:(OLMAccount*)account theirIdentityKey:(NSString*)theirIdentityKey oneTimeKeyMessage:(NSString*)oneTimeKeyMessage;
2016-04-09 02:24:41 +02:00
2016-04-09 23:00:30 +02:00
- (NSString*) sessionIdentifier;
2016-04-09 02:24:41 +02:00
2016-04-09 23:00:30 +02:00
- (BOOL) matchesInboundSession:(NSString*)oneTimeKeyMessage;
2016-04-09 02:24:41 +02:00
2016-04-09 23:00:30 +02:00
- (BOOL) matchesInboundSessionFrom:(NSString*)theirIdentityKey oneTimeKeyMessage:(NSString *)oneTimeKeyMessage;
/** UTF-8 plaintext -> base64 ciphertext */
- (OLMMessage*) encryptMessage:(NSString*)message;
/** base64 ciphertext -> UTF-8 plaintext */
- (NSString*) decryptMessage:(OLMMessage*)message;
2016-04-09 02:24:41 +02:00
@end