olm/xcode/OLMKit/OLMKit.h
manuroe b69b56d0bb OLMKit: New pickle version using a pickle key provided externally
Improve ObjC wrappers so that they can use a pickle key provided by the olm lib user.

This new behavior is optional to not break existing usage.

It is retro compatible and use pickle versioning already in place. 
Existing key will be unpickled with pickle v1 and pickled with pickle v2 if an external pickle key is provided.
2021-02-19 09:23:36 +01:00

61 lines
1.7 KiB
Objective-C

/*
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 <Foundation/Foundation.h>
// In this header, you should import all the public headers of your framework using statements like #import <OLMKit/PublicHeader.h>
#import <OLMKit/OLMAccount.h>
#import <OLMKit/OLMSession.h>
#import <OLMKit/OLMMessage.h>
#import <OLMKit/OLMUtility.h>
#import <OLMKit/OLMInboundGroupSession.h>
#import <OLMKit/OLMOutboundGroupSession.h>
#import <OLMKit/OLMPkEncryption.h>
#import <OLMKit/OLMPkDecryption.h>
#import <OLMKit/OLMPkSigning.h>
#import <OLMKit/OLMSAS.h>
NS_ASSUME_NONNULL_BEGIN
/**
`OLMKitPickleKeyDelegate` provides the key to use for every pickle operation.
*/
@protocol OLMKitPickleKeyDelegate <NSObject>
- (NSData*)pickleKey;
@end
@interface OLMKit : NSObject
/// Project version string for OLMKit, the same as libolm.
+ (NSString*)versionString;
/// The optional delegate that provides the pickle key.
/// If not provided, OLMKit will use default pickle keys.
@property (nonatomic, weak, nullable) id<OLMKitPickleKeyDelegate> pickleKeyDelegate;
/// The singleton instance.
+ (instancetype)sharedInstance;
@end
NS_ASSUME_NONNULL_END