-
Notifications
You must be signed in to change notification settings - Fork 219
/
VALLegacyValet_Protected.h
52 lines (41 loc) · 2.72 KB
/
VALLegacyValet_Protected.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// VALLegacyValet_Protected.h
// Valet
//
// Created by Dan Federman on 3/16/15.
// Copyright 2015 Square, Inc.
//
// 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 "VALLegacyValet.h"
extern NSString * __nonnull VALStringForAccessibility(VALLegacyAccessibility accessibility);
extern void VALAtomicSecItemLock(__nonnull dispatch_block_t block);
@interface VALLegacyValet ()
/// Ensures the atomicity for set and remove operations by limiting ourselves to one instance per configuration.
/// @return An existing valet object with the same configuration as the valet provided if one exists, or the passed in valet.
+ (nonnull id)sharedValetForValet:(nonnull VALLegacyValet *)valet;
/// Creates a base query given the injected properties. Do not override.
+ (nullable NSMutableDictionary *)mutableBaseQueryWithIdentifier:(nonnull NSString *)identifier accessibility:(VALLegacyAccessibility)accessibility initializer:(nonnull SEL)initializer;
/// Creates a base query for shared access group Valets given the injected properties. Do not override.
+ (nullable NSMutableDictionary *)mutableBaseQueryWithSharedAccessGroupIdentifier:(nonnull NSString *)sharedAccessGroupIdentifier accessibility:(VALLegacyAccessibility)accessibility initializer:(nonnull SEL)initializer;
/// Stores the root query to be used in all SecItem queries.
@property (nonnull, copy, readonly) NSDictionary *baseQuery;
- (BOOL)setObject:(nonnull NSData *)value forKey:(nonnull NSString *)key options:(nullable NSDictionary *)options;
- (nullable NSData *)objectForKey:(nonnull NSString *)key options:(nullable NSDictionary *)options status:(nullable inout OSStatus *)status;
- (BOOL)setString:(nonnull NSString *)string forKey:(nonnull NSString *)key options:(nullable NSDictionary *)options;
- (nullable NSString *)stringForKey:(nonnull NSString *)key options:(nullable NSDictionary *)options status:(nullable inout OSStatus *)status;
- (OSStatus)containsObjectForKey:(nonnull NSString *)key options:(nullable NSDictionary *)options;
- (nonnull NSSet *)allKeysWithOptions:(nullable NSDictionary *)options;
- (BOOL)removeObjectForKey:(nonnull NSString *)key options:(nullable NSDictionary *)options;
- (BOOL)removeAllObjectsWithOptions:(nullable NSDictionary *)options;
@end