MyIdentityStore.h 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // _____ _
  2. // |_ _| |_ _ _ ___ ___ _ __ __ _
  3. // | | | ' \| '_/ -_) -_) ' \/ _` |_
  4. // |_| |_||_|_| \___\___|_|_|_\__,_(_)
  5. //
  6. // Threema iOS Client
  7. // Copyright (c) 2012-2020 Threema GmbH
  8. //
  9. // This program is free software: you can redistribute it and/or modify
  10. // it under the terms of the GNU Affero General Public License, version 3,
  11. // as published by the Free Software Foundation.
  12. //
  13. // This program is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. // GNU Affero General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Affero General Public License
  19. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. #import <Foundation/Foundation.h>
  21. @interface MyIdentityStore : NSObject
  22. @property (strong, nonatomic, readwrite) NSString *identity;
  23. @property (strong, nonatomic, readwrite) NSString *serverGroup;
  24. @property (strong, nonatomic, readonly) NSData *publicKey;
  25. @property (strong, nonatomic, readwrite) NSString *pushFromName;
  26. @property (strong, nonatomic, readwrite) NSMutableDictionary *profilePicture;
  27. @property (nonatomic, readwrite) BOOL linkEmailPending;
  28. @property (strong, nonatomic, readwrite) NSString *linkedEmail;
  29. @property (nonatomic, readwrite) BOOL linkMobileNoPending;
  30. @property (strong, nonatomic, readwrite) NSString *linkMobileNoVerificationId;
  31. @property (strong, nonatomic, readwrite) NSDate *linkMobileNoStartDate;
  32. @property (strong, nonatomic, readwrite) NSString *linkedMobileNo;
  33. @property (strong, nonatomic, readwrite) NSDate *privateIdentityInfoLastUpdate;
  34. @property (nonatomic, readwrite) NSInteger lastSentFeatureMask;
  35. @property (strong, nonatomic, readwrite) NSDate *revocationPasswordSetDate;
  36. @property (strong, nonatomic, readwrite) NSDate *revocationPasswordLastCheck;
  37. @property (strong, nonatomic, readwrite) NSDate *licenseLastCheck;
  38. @property (strong, nonatomic, readwrite) NSString *licenseLogoLightUrl;
  39. @property (strong, nonatomic, readwrite) NSString *licenseLogoDarkUrl;
  40. @property (strong, nonatomic, readwrite) NSString *licenseSupportUrl;
  41. @property (nonatomic, readwrite) BOOL pendingCreateID;
  42. @property (strong, nonatomic, readwrite) NSString *createIDEmail;
  43. @property (strong, nonatomic, readwrite) NSString *createIDPhone;
  44. @property (strong, nonatomic, readwrite) NSString *firstName;
  45. @property (strong, nonatomic, readwrite) NSString *lastName;
  46. @property (strong, nonatomic, readwrite) NSString *csi;
  47. @property (strong, nonatomic, readwrite) NSString *category;
  48. @property (strong, nonatomic, readwrite) NSString *companyName;
  49. @property (strong, nonatomic, readwrite) NSMutableDictionary *directoryCategories;
  50. @property (strong, nonatomic, readwrite) NSString *tempSafePassword;
  51. @property (strong, nonatomic, readwrite) NSDictionary *lastWorkUpdateRequest;
  52. @property (strong, nonatomic, readwrite) NSDate *lastWorkUpdateDate;
  53. + (MyIdentityStore*)sharedMyIdentityStore;
  54. + (void)resetSharedInstance;
  55. - (BOOL)isProvisioned;
  56. - (BOOL)isKeychainLocked;
  57. - (void)generateKeyPairWithSeed:(NSData*)seed;
  58. - (void)destroy;
  59. - (void)storeInKeychain;
  60. - (void)updateConnectionRights;
  61. - (NSArray *)directoryCategoryIdsSortedByName;
  62. - (NSData*)encryptData:(NSData*)data withNonce:(NSData*)nonce publicKey:(NSData*)publicKey;
  63. - (NSData*)decryptData:(NSData*)data withNonce:(NSData*)nonce publicKey:(NSData*)_publicKey;
  64. - (NSString*)keyFingerprint;
  65. - (NSData*)keySecret;
  66. - (NSString*)backupIdentityWithPassword:(NSString*)password;
  67. - (NSString*)addBackupGroupDashes:(NSString*)backup;
  68. - (void)restoreFromBackup:(NSString*)backup withPassword:(NSString*)password onCompletion:(void(^)(void))onCompletion onError:(void(^)(NSError *error))onError;
  69. - (void)restoreFromBackup:(NSString*)myIdentity withSecretKey:(NSData*)mySecretKey onCompletion:(void(^)(void))onCompletion onError:(void(^)(NSError *error))onError;
  70. - (BOOL)isValidBackupFormat:(NSString*)backup;
  71. - (BOOL)sendUpdateWorkInfoStatus;
  72. @end