From 719eb543a8d08c4f536ea7933ffb3af0a8553e87 Mon Sep 17 00:00:00 2001 From: Chris Ballinger Date: Fri, 8 Apr 2016 17:24:41 -0700 Subject: Xcode, podspec, wrapper --- xcode/OLMKit/OLMSession.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 xcode/OLMKit/OLMSession.h (limited to 'xcode/OLMKit/OLMSession.h') diff --git a/xcode/OLMKit/OLMSession.h b/xcode/OLMKit/OLMSession.h new file mode 100644 index 0000000..196900f --- /dev/null +++ b/xcode/OLMKit/OLMSession.h @@ -0,0 +1,29 @@ +// +// OLMSession.h +// olm +// +// Created by Chris Ballinger on 4/8/16. +// +// + +#import +#import "OLMSerializable.h" +#import "OLMAccount.h" + +@interface OLMSession : NSObject + +- (instancetype) initOutboundSessionWithAccount:(OLMAccount*)account theirIdentityKey:(NSData*)theirIdentityKey theirOneTimeKey:(NSData*)theirOneTimeKey; + +- (instancetype) initInboundSessionWithAccount:(OLMAccount*)account oneTimeKeyMessage:(NSData*)oneTimeKeyMessage; + +- (instancetype) initInboundSessionWithAccount:(OLMAccount*)account theirIdentityKey:(NSData*)theirIdentityKey oneTimeKeyMessage:(NSData*)oneTimeKeyMessage; + +- (NSData*) sessionIdentifier; + +- (BOOL) matchesInboundSession:(NSData*)oneTimeKeyMessage; + +- (BOOL) matchesInboundSessionFrom:(NSData*)theirIdentityKey oneTimeKeyMessage:(NSData *)oneTimeKeyMessage; + +- (void) removeOneTimeKeys; + +@end -- cgit v1.2.3 From f505113fb7a6d61015ad8050b3fb4e26df029150 Mon Sep 17 00:00:00 2001 From: Chris Ballinger Date: Sat, 9 Apr 2016 14:00:30 -0700 Subject: Initial test passing --- xcode/OLMKit/OLMSession.h | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'xcode/OLMKit/OLMSession.h') diff --git a/xcode/OLMKit/OLMSession.h b/xcode/OLMKit/OLMSession.h index 196900f..1a075e4 100644 --- a/xcode/OLMKit/OLMSession.h +++ b/xcode/OLMKit/OLMSession.h @@ -9,21 +9,30 @@ #import #import "OLMSerializable.h" #import "OLMAccount.h" +#import "OLMMessage.h" @interface OLMSession : NSObject -- (instancetype) initOutboundSessionWithAccount:(OLMAccount*)account theirIdentityKey:(NSData*)theirIdentityKey theirOneTimeKey:(NSData*)theirOneTimeKey; +@property (nonatomic, strong) OLMAccount *account; -- (instancetype) initInboundSessionWithAccount:(OLMAccount*)account oneTimeKeyMessage:(NSData*)oneTimeKeyMessage; +- (instancetype) initOutboundSessionWithAccount:(OLMAccount*)account theirIdentityKey:(NSString*)theirIdentityKey theirOneTimeKey:(NSString*)theirOneTimeKey; -- (instancetype) initInboundSessionWithAccount:(OLMAccount*)account theirIdentityKey:(NSData*)theirIdentityKey oneTimeKeyMessage:(NSData*)oneTimeKeyMessage; +- (instancetype) initInboundSessionWithAccount:(OLMAccount*)account oneTimeKeyMessage:(NSString*)oneTimeKeyMessage; -- (NSData*) sessionIdentifier; +- (instancetype) initInboundSessionWithAccount:(OLMAccount*)account theirIdentityKey:(NSString*)theirIdentityKey oneTimeKeyMessage:(NSString*)oneTimeKeyMessage; -- (BOOL) matchesInboundSession:(NSData*)oneTimeKeyMessage; +- (NSString*) sessionIdentifier; -- (BOOL) matchesInboundSessionFrom:(NSData*)theirIdentityKey oneTimeKeyMessage:(NSData *)oneTimeKeyMessage; +- (BOOL) matchesInboundSession:(NSString*)oneTimeKeyMessage; -- (void) removeOneTimeKeys; +- (BOOL) matchesInboundSessionFrom:(NSString*)theirIdentityKey oneTimeKeyMessage:(NSString *)oneTimeKeyMessage; + +- (BOOL) removeOneTimeKeys; + +/** UTF-8 plaintext -> base64 ciphertext */ +- (OLMMessage*) encryptMessage:(NSString*)message; + +/** base64 ciphertext -> UTF-8 plaintext */ +- (NSString*) decryptMessage:(OLMMessage*)message; @end -- cgit v1.2.3 From daab2a58af947cddd67fe9f30dd3a9fc327650c0 Mon Sep 17 00:00:00 2001 From: Chris Ballinger Date: Wed, 13 Apr 2016 16:53:47 -0700 Subject: OLMAccount and OLMSession serialization --- xcode/OLMKit/OLMSession.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'xcode/OLMKit/OLMSession.h') diff --git a/xcode/OLMKit/OLMSession.h b/xcode/OLMKit/OLMSession.h index 1a075e4..c209564 100644 --- a/xcode/OLMKit/OLMSession.h +++ b/xcode/OLMKit/OLMSession.h @@ -11,9 +11,7 @@ #import "OLMAccount.h" #import "OLMMessage.h" -@interface OLMSession : NSObject - -@property (nonatomic, strong) OLMAccount *account; +@interface OLMSession : NSObject - (instancetype) initOutboundSessionWithAccount:(OLMAccount*)account theirIdentityKey:(NSString*)theirIdentityKey theirOneTimeKey:(NSString*)theirOneTimeKey; @@ -27,8 +25,6 @@ - (BOOL) matchesInboundSessionFrom:(NSString*)theirIdentityKey oneTimeKeyMessage:(NSString *)oneTimeKeyMessage; -- (BOOL) removeOneTimeKeys; - /** UTF-8 plaintext -> base64 ciphertext */ - (OLMMessage*) encryptMessage:(NSString*)message; -- cgit v1.2.3 From cf66af6f2e7c69a3e0712317f8473ab09711d426 Mon Sep 17 00:00:00 2001 From: manuroe Date: Mon, 14 Nov 2016 16:54:51 +0100 Subject: OLMKit: Replaced NSAsserts by NSErrors --- xcode/OLMKit/OLMSession.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'xcode/OLMKit/OLMSession.h') diff --git a/xcode/OLMKit/OLMSession.h b/xcode/OLMKit/OLMSession.h index c209564..b10e481 100644 --- a/xcode/OLMKit/OLMSession.h +++ b/xcode/OLMKit/OLMSession.h @@ -13,11 +13,11 @@ @interface OLMSession : NSObject -- (instancetype) initOutboundSessionWithAccount:(OLMAccount*)account theirIdentityKey:(NSString*)theirIdentityKey theirOneTimeKey:(NSString*)theirOneTimeKey; +- (instancetype) initOutboundSessionWithAccount:(OLMAccount*)account theirIdentityKey:(NSString*)theirIdentityKey theirOneTimeKey:(NSString*)theirOneTimeKey error:(NSError**)error; -- (instancetype) initInboundSessionWithAccount:(OLMAccount*)account oneTimeKeyMessage:(NSString*)oneTimeKeyMessage; +- (instancetype) initInboundSessionWithAccount:(OLMAccount*)account oneTimeKeyMessage:(NSString*)oneTimeKeyMessage error:(NSError**)error; -- (instancetype) initInboundSessionWithAccount:(OLMAccount*)account theirIdentityKey:(NSString*)theirIdentityKey oneTimeKeyMessage:(NSString*)oneTimeKeyMessage; +- (instancetype) initInboundSessionWithAccount:(OLMAccount*)account theirIdentityKey:(NSString*)theirIdentityKey oneTimeKeyMessage:(NSString*)oneTimeKeyMessage error:(NSError**)error; - (NSString*) sessionIdentifier; @@ -26,9 +26,9 @@ - (BOOL) matchesInboundSessionFrom:(NSString*)theirIdentityKey oneTimeKeyMessage:(NSString *)oneTimeKeyMessage; /** UTF-8 plaintext -> base64 ciphertext */ -- (OLMMessage*) encryptMessage:(NSString*)message; +- (OLMMessage*) encryptMessage:(NSString*)message error:(NSError**)error; /** base64 ciphertext -> UTF-8 plaintext */ -- (NSString*) decryptMessage:(OLMMessage*)message; +- (NSString*) decryptMessage:(OLMMessage*)message error:(NSError**)error; @end -- cgit v1.2.3 From 29de7825c9607955d061c5fe75c7f29d78dfaec5 Mon Sep 17 00:00:00 2001 From: manuroe Date: Thu, 17 Nov 2016 15:50:23 +0100 Subject: OLMKit: Update Copyrights --- xcode/OLMKit/OLMSession.h | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'xcode/OLMKit/OLMSession.h') diff --git a/xcode/OLMKit/OLMSession.h b/xcode/OLMKit/OLMSession.h index b10e481..0446f98 100644 --- a/xcode/OLMKit/OLMSession.h +++ b/xcode/OLMKit/OLMSession.h @@ -1,10 +1,20 @@ -// -// OLMSession.h -// olm -// -// Created by Chris Ballinger on 4/8/16. -// -// +/* + Copyright 2016 Chris Ballinger + Copyright 2016 OpenMarket Ltd + Copyright 2016 Vector Creations Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ #import #import "OLMSerializable.h" -- cgit v1.2.3