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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2_core_foundation::*;
use crate::*;
#[cfg(feature = "SecBase")]
unsafe impl ConcreteType for SecTrustedApplication {
/// Returns the type identifier of SecTrustedApplication instances.
///
/// Returns: The CFTypeID of SecTrustedApplication instances.
#[doc(alias = "SecTrustedApplicationGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn SecTrustedApplicationGetTypeID() -> CFTypeID;
}
unsafe { SecTrustedApplicationGetTypeID() }
}
}
#[cfg(feature = "SecBase")]
impl SecTrustedApplication {
/// Creates a trusted application reference based on the trusted application specified by path.
///
/// Parameter `path`: The path to the application or tool to trust. For application bundles, use the
/// path to the bundle directory. Pass NULL to refer to yourself, i.e. the application or tool
/// making this call.
///
/// Parameter `app`: On return, a pointer to the trusted application reference.
///
/// Returns: A result code. See "Security Error Codes" (SecBase.h).
///
/// # Safety
///
/// - `path` must be a valid pointer or null.
/// - `app` must be a valid pointer.
#[doc(alias = "SecTrustedApplicationCreateFromPath")]
#[cfg(feature = "SecBase")]
#[deprecated = "SecKeychain is deprecated"]
#[inline]
pub unsafe fn create_from_path(
path: *const c_char,
app: NonNull<*mut SecTrustedApplication>,
) -> OSStatus {
extern "C-unwind" {
fn SecTrustedApplicationCreateFromPath(
path: *const c_char,
app: NonNull<*mut SecTrustedApplication>,
) -> OSStatus;
}
unsafe { SecTrustedApplicationCreateFromPath(path, app) }
}
/// Retrieves the data of a given trusted application reference
///
/// Parameter `appRef`: A trusted application reference to retrieve data from
///
/// Parameter `data`: On return, a pointer to a data reference of the trusted application.
///
/// Returns: A result code. See "Security Error Codes" (SecBase.h).
///
/// # Safety
///
/// `data` must be a valid pointer.
#[doc(alias = "SecTrustedApplicationCopyData")]
#[cfg(feature = "SecBase")]
#[deprecated = "SecKeychain is deprecated"]
#[inline]
pub unsafe fn copy_data(&self, data: NonNull<*const CFData>) -> OSStatus {
extern "C-unwind" {
fn SecTrustedApplicationCopyData(
app_ref: &SecTrustedApplication,
data: NonNull<*const CFData>,
) -> OSStatus;
}
unsafe { SecTrustedApplicationCopyData(self, data) }
}
/// Sets the data of a given trusted application reference
///
/// Parameter `appRef`: A trusted application reference.
///
/// Parameter `data`: A reference to the data to set in the trusted application.
///
/// Returns: A result code. See "Security Error Codes" (SecBase.h).
#[doc(alias = "SecTrustedApplicationSetData")]
#[cfg(feature = "SecBase")]
#[deprecated = "SecKeychain is deprecated"]
#[inline]
pub unsafe fn set_data(&self, data: &CFData) -> OSStatus {
extern "C-unwind" {
fn SecTrustedApplicationSetData(
app_ref: &SecTrustedApplication,
data: &CFData,
) -> OSStatus;
}
unsafe { SecTrustedApplicationSetData(self, data) }
}
}
extern "C-unwind" {
#[cfg(feature = "SecBase")]
#[deprecated = "renamed to `SecTrustedApplication::create_from_path`"]
pub fn SecTrustedApplicationCreateFromPath(
path: *const c_char,
app: NonNull<*mut SecTrustedApplication>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "SecBase")]
#[deprecated = "renamed to `SecTrustedApplication::copy_data`"]
pub fn SecTrustedApplicationCopyData(
app_ref: &SecTrustedApplication,
data: NonNull<*const CFData>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "SecBase")]
#[deprecated = "renamed to `SecTrustedApplication::set_data`"]
pub fn SecTrustedApplicationSetData(app_ref: &SecTrustedApplication, data: &CFData)
-> OSStatus;
}