security_framework_sys/
keychain_item.rs1#[cfg(target_os = "macos")]
2use crate::base::{SecKeychainAttributeList, SecKeychainItemRef};
3#[cfg(target_os = "macos")]
4use core_foundation_sys::base::CFTypeID;
5use core_foundation_sys::base::{CFTypeRef, OSStatus};
6use core_foundation_sys::dictionary::CFDictionaryRef;
7#[cfg(target_os = "macos")]
8use std::os::raw::c_void;
9
10extern "C" {
11
12 #[cfg(target_os = "macos")]
14 pub fn SecKeychainItemGetTypeID() -> CFTypeID;
15
16 pub fn SecItemAdd(attributes: CFDictionaryRef, result: *mut CFTypeRef) -> OSStatus;
18
19 pub fn SecItemCopyMatching(query: CFDictionaryRef, result: *mut CFTypeRef) -> OSStatus;
21
22 pub fn SecItemUpdate(query: CFDictionaryRef, attributesToUpdate: CFDictionaryRef) -> OSStatus;
24
25 pub fn SecItemDelete(query: CFDictionaryRef) -> OSStatus;
27
28 #[cfg(target_os = "macos")]
30 pub fn SecKeychainItemModifyAttributesAndData(
31 itemRef: SecKeychainItemRef,
32 attrList: *const SecKeychainAttributeList,
33 length: u32,
34 data: *const c_void,
35 ) -> OSStatus;
36
37 #[cfg(target_os = "macos")]
38 pub fn SecKeychainItemFreeContent(
39 attrList: *mut SecKeychainAttributeList,
40 data: *mut c_void,
41 ) -> OSStatus;
42
43 #[cfg(target_os = "macos")]
44 pub fn SecKeychainItemDelete(itemRef: SecKeychainItemRef) -> OSStatus;
45}