-
Notifications
You must be signed in to change notification settings - Fork 117
/
DBSDKKeychain.h
35 lines (25 loc) · 1.15 KB
/
DBSDKKeychain.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
///
/// Copyright (c) 2016 Dropbox, Inc. All rights reserved.
///
#import <Foundation/Foundation.h>
#import "DBHandlerTypes.h"
///
/// Keychain class for storing OAuth tokens.
///
@interface DBSDKKeychain : NSObject
/// Stores a key / value pair in the keychain.
+ (BOOL)storeValueWithKey:(NSString * _Nonnull)key value:(NSString * _Nonnull)value;
/// Retrieves a value from the corresponding key from the keychain.
+ (NSString * _Nullable)retrieveTokenWithKey:(NSString * _Nonnull)key;
/// Retrieves all token uids from the keychain.
+ (NSArray<NSString *> * _Nonnull)retrieveAllTokenIds;
/// Deletes a key / value pair in the keychain.
+ (BOOL)deleteTokenWithKey:(NSString * _Nonnull)key;
/// Deletes all key / value pairs in the keychain.
+ (BOOL)clearAllTokens;
/// Checks if performing a v1 token migration is necessary, and if so, performs it.
+ (BOOL)checkAndPerformV1TokenMigration:(DBTokenMigrationResponseBlock _Nonnull)responseBlock
queue:(NSOperationQueue * _Nullable)queue
appKey:(NSString * _Nonnull)appKey
appSecret:(NSString * _Nonnull)appSecret;
@end