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
use crate::base::{SecKeychainAttributeList, SecKeychainItemRef};
use core_foundation_sys::base::{CFTypeID, CFTypeRef, OSStatus};
use core_foundation_sys::dictionary::CFDictionaryRef;
use std::os::raw::c_void;
extern "C" {
pub fn SecKeychainItemGetTypeID() -> CFTypeID;
pub fn SecItemAdd(attributes: CFDictionaryRef, result: *mut CFTypeRef) -> OSStatus;
pub fn SecItemCopyMatching(query: CFDictionaryRef, result: *mut CFTypeRef) -> OSStatus;
pub fn SecItemUpdate(query: CFDictionaryRef, attributesToUpdate: CFDictionaryRef) -> OSStatus;
pub fn SecItemDelete(query: CFDictionaryRef) -> OSStatus;
pub fn SecKeychainItemModifyAttributesAndData(
itemRef: SecKeychainItemRef,
attrList: *const SecKeychainAttributeList,
length: u32,
data: *const c_void,
) -> OSStatus;
pub fn SecKeychainItemFreeContent(
attrList: *mut SecKeychainAttributeList,
data: *mut c_void,
) -> OSStatus;
pub fn SecKeychainItemDelete(itemRef: SecKeychainItemRef) -> OSStatus;
}