hank
2018-06-21 2cfb267ecc1bea8bc564466a1620535018dce77c
commit | author | age
655e66 1 /*
H 2  * Copyright (C) 2017 Twitter, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 /**
19  This header is private to the Twitter Core SDK and not exposed for public SDK consumption
20  */
21
22 #import <Foundation/Foundation.h>
23
24 NS_ASSUME_NONNULL_BEGIN
25
26 /**
27  * SecItem methods are wrapped so they can be mocked in unit tests using OCMock because the behaviour of
28  * these methods is inconsistent in a testing environment.
29  */
30 @interface TWTRSecItemWrapper : NSObject
31
32 /**
33  * Calls SecItemAdd()
34  */
35 + (OSStatus)secItemAdd:(CFDictionaryRef)attributes withResult:(CFTypeRef *__nullable CF_RETURNS_RETAINED)result;
36
37 /**
38  * Calls SecItemDelegate()
39  */
40 + (OSStatus)secItemDelete:(CFDictionaryRef)query;
41
42 /**
43  * Calls SecItemCopyMatching()
44  */
45 + (OSStatus)secItemCopyMatching:(CFDictionaryRef)query withResult:(CFTypeRef *__nullable CF_RETURNS_RETAINED)result;
46
47 /**
48  * Calls SecItemUpdate()
49  */
50 + (OSStatus)secItemUpdate:(CFDictionaryRef)query withAttributes:(CFDictionaryRef)attributes;
51
52 @end
53
54 NS_ASSUME_NONNULL_END