objc2_security/generated/
Authorization.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7#[cfg(feature = "objc2")]
8use objc2::__framework_prelude::*;
9
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/security/kauthorizationexternalformlength?language=objc)
13pub const kAuthorizationExternalFormLength: c_uint = 32;
14/// [Apple's documentation](https://developer.apple.com/documentation/security/errauthorizationsuccess?language=objc)
15pub const errAuthorizationSuccess: OSStatus = 0;
16/// [Apple's documentation](https://developer.apple.com/documentation/security/errauthorizationinvalidset?language=objc)
17pub const errAuthorizationInvalidSet: OSStatus = -60001;
18/// [Apple's documentation](https://developer.apple.com/documentation/security/errauthorizationinvalidref?language=objc)
19pub const errAuthorizationInvalidRef: OSStatus = -60002;
20/// [Apple's documentation](https://developer.apple.com/documentation/security/errauthorizationinvalidtag?language=objc)
21pub const errAuthorizationInvalidTag: OSStatus = -60003;
22/// [Apple's documentation](https://developer.apple.com/documentation/security/errauthorizationinvalidpointer?language=objc)
23pub const errAuthorizationInvalidPointer: OSStatus = -60004;
24/// [Apple's documentation](https://developer.apple.com/documentation/security/errauthorizationdenied?language=objc)
25pub const errAuthorizationDenied: OSStatus = -60005;
26/// [Apple's documentation](https://developer.apple.com/documentation/security/errauthorizationcanceled?language=objc)
27pub const errAuthorizationCanceled: OSStatus = -60006;
28/// [Apple's documentation](https://developer.apple.com/documentation/security/errauthorizationinteractionnotallowed?language=objc)
29pub const errAuthorizationInteractionNotAllowed: OSStatus = -60007;
30/// [Apple's documentation](https://developer.apple.com/documentation/security/errauthorizationinternal?language=objc)
31pub const errAuthorizationInternal: OSStatus = -60008;
32/// [Apple's documentation](https://developer.apple.com/documentation/security/errauthorizationexternalizenotallowed?language=objc)
33pub const errAuthorizationExternalizeNotAllowed: OSStatus = -60009;
34/// [Apple's documentation](https://developer.apple.com/documentation/security/errauthorizationinternalizenotallowed?language=objc)
35pub const errAuthorizationInternalizeNotAllowed: OSStatus = -60010;
36/// [Apple's documentation](https://developer.apple.com/documentation/security/errauthorizationinvalidflags?language=objc)
37pub const errAuthorizationInvalidFlags: OSStatus = -60011;
38/// [Apple's documentation](https://developer.apple.com/documentation/security/errauthorizationtoolexecutefailure?language=objc)
39pub const errAuthorizationToolExecuteFailure: OSStatus = -60031;
40/// [Apple's documentation](https://developer.apple.com/documentation/security/errauthorizationtoolenvironmenterror?language=objc)
41pub const errAuthorizationToolEnvironmentError: OSStatus = -60032;
42/// [Apple's documentation](https://developer.apple.com/documentation/security/errauthorizationbadaddress?language=objc)
43pub const errAuthorizationBadAddress: OSStatus = -60033;
44
45/// Optional flags passed in to several Authorization APIs.
46/// See the description of AuthorizationCreate, AuthorizationCopyRights and AuthorizationFree for a description of how they affect those calls.
47///
48/// See also [Apple's documentation](https://developer.apple.com/documentation/security/authorizationflags?language=objc)
49// NS_OPTIONS
50#[repr(transparent)]
51#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
52pub struct AuthorizationFlags(pub u32);
53bitflags::bitflags! {
54    impl AuthorizationFlags: u32 {
55        #[doc(alias = "kAuthorizationFlagDefaults")]
56        const Defaults = 0;
57        #[doc(alias = "kAuthorizationFlagInteractionAllowed")]
58        const InteractionAllowed = 1<<0;
59        #[doc(alias = "kAuthorizationFlagExtendRights")]
60        const ExtendRights = 1<<1;
61        #[doc(alias = "kAuthorizationFlagPartialRights")]
62        const PartialRights = 1<<2;
63        #[doc(alias = "kAuthorizationFlagDestroyRights")]
64        const DestroyRights = 1<<3;
65        #[doc(alias = "kAuthorizationFlagPreAuthorize")]
66        const PreAuthorize = 1<<4;
67        #[doc(alias = "kAuthorizationFlagSkipInternalAuth")]
68        const SkipInternalAuth = 1<<9;
69        #[doc(alias = "kAuthorizationFlagNoData")]
70        const NoData = 1<<20;
71    }
72}
73
74#[cfg(feature = "objc2")]
75unsafe impl Encode for AuthorizationFlags {
76    const ENCODING: Encoding = u32::ENCODING;
77}
78
79#[cfg(feature = "objc2")]
80unsafe impl RefEncode for AuthorizationFlags {
81    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
82}
83
84/// [Apple's documentation](https://developer.apple.com/documentation/security/kauthorizationflagcannotpreauthorize?language=objc)
85pub const kAuthorizationFlagCanNotPreAuthorize: c_uint = 1;
86
87/// [Apple's documentation](https://developer.apple.com/documentation/security/authorizationopaqueref?language=objc)
88#[repr(C)]
89#[derive(Debug)]
90pub struct AuthorizationOpaqueRef {
91    inner: [u8; 0],
92    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
93}
94
95#[cfg(feature = "objc2")]
96unsafe impl RefEncode for AuthorizationOpaqueRef {
97    const ENCODING_REF: Encoding =
98        Encoding::Pointer(&Encoding::Struct("AuthorizationOpaqueRef", &[]));
99}
100
101/// Opaque reference to an authorization object.
102///
103/// See also [Apple's documentation](https://developer.apple.com/documentation/security/authorizationref?language=objc)
104pub type AuthorizationRef = *const AuthorizationOpaqueRef;
105
106/// A zero terminated string in UTF-8 encoding.
107///
108/// See also [Apple's documentation](https://developer.apple.com/documentation/security/authorizationstring?language=objc)
109pub type AuthorizationString = *const c_char;
110
111/// Each AuthorizationItem describes a single string-named item with optional
112/// parameter value. The value must be contiguous memory of valueLength bytes;
113/// internal structure is defined separately for each name.
114///
115/// Field: name name of the item, as an AuthorizationString. Mandatory.
116/// Field: valueLength Number of bytes in parameter value. Must be 0 if no parameter value.
117/// Field: value Pointer to the optional parameter value associated with name.
118/// Must be NULL if no parameter value.
119/// Field: flags Reserved field. Must be set to 0 on creation. Do not modify after that.
120///
121/// See also [Apple's documentation](https://developer.apple.com/documentation/security/authorizationitem?language=objc)
122#[repr(C)]
123#[derive(Clone, Copy, Debug, PartialEq)]
124pub struct AuthorizationItem {
125    pub name: AuthorizationString,
126    pub valueLength: usize,
127    pub value: *mut c_void,
128    pub flags: u32,
129}
130
131#[cfg(feature = "objc2")]
132unsafe impl Encode for AuthorizationItem {
133    const ENCODING: Encoding = Encoding::Struct(
134        "?",
135        &[
136            <AuthorizationString>::ENCODING,
137            <usize>::ENCODING,
138            <*mut c_void>::ENCODING,
139            <u32>::ENCODING,
140        ],
141    );
142}
143
144#[cfg(feature = "objc2")]
145unsafe impl RefEncode for AuthorizationItem {
146    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
147}
148
149/// An AuthorizationItemSet structure represents a set of zero or more AuthorizationItems.  Since it is a set it should not contain any identical AuthorizationItems.
150///
151/// Field: count Number of items identified by items.
152/// Field: items Pointer to an array of items.
153///
154/// See also [Apple's documentation](https://developer.apple.com/documentation/security/authorizationitemset?language=objc)
155#[repr(C)]
156#[derive(Clone, Copy, Debug, PartialEq)]
157pub struct AuthorizationItemSet {
158    pub count: u32,
159    pub items: *mut AuthorizationItem,
160}
161
162#[cfg(feature = "objc2")]
163unsafe impl Encode for AuthorizationItemSet {
164    const ENCODING: Encoding =
165        Encoding::Struct("?", &[<u32>::ENCODING, <*mut AuthorizationItem>::ENCODING]);
166}
167
168#[cfg(feature = "objc2")]
169unsafe impl RefEncode for AuthorizationItemSet {
170    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
171}
172
173/// An AuthorizationExternalForm structure can hold the externalized form of
174/// an AuthorizationRef. As such, it can be transmitted across IPC channels
175/// to other processes, which can re-internalize it to recover a valid AuthorizationRef
176/// handle.
177/// The data contained in an AuthorizationExternalForm should be considered opaque.
178///
179/// SECURITY NOTE: Applications should take care to not disclose the AuthorizationExternalForm to
180/// potential attackers since it would authorize rights to them.
181///
182/// See also [Apple's documentation](https://developer.apple.com/documentation/security/authorizationexternalform?language=objc)
183#[repr(C)]
184#[derive(Clone, Copy, Debug, PartialEq)]
185pub struct AuthorizationExternalForm {
186    pub bytes: [c_char; 32],
187}
188
189#[cfg(feature = "objc2")]
190unsafe impl Encode for AuthorizationExternalForm {
191    const ENCODING: Encoding = Encoding::Struct("?", &[<[c_char; 32]>::ENCODING]);
192}
193
194#[cfg(feature = "objc2")]
195unsafe impl RefEncode for AuthorizationExternalForm {
196    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
197}
198
199/// An AuthorizationItemSet representing a set of rights each with an associated argument (value).
200/// Each argument value is as defined for the specific right they belong to.  Argument values may not contain pointers as the should be copyable to different address spaces.
201///
202/// See also [Apple's documentation](https://developer.apple.com/documentation/security/authorizationrights?language=objc)
203pub type AuthorizationRights = AuthorizationItemSet;
204
205/// An AuthorizationItemSet representing environmental information of potential use
206/// to authorization decisions.
207///
208/// See also [Apple's documentation](https://developer.apple.com/documentation/security/authorizationenvironment?language=objc)
209pub type AuthorizationEnvironment = AuthorizationItemSet;
210
211extern "C-unwind" {
212    /// Create a new autorization object which can be used in other authorization calls.  When the authorization is no longer needed AuthorizationFree should be called.
213    ///
214    /// When the kAuthorizationFlagInteractionAllowed flag is set, user interaction will happen when required.  Failing to set this flag will result in this call failing with a errAuthorizationInteractionNotAllowed status when interaction is required.
215    ///
216    /// Setting the kAuthorizationFlagExtendRights flag will extend the currently available rights. If this flag is set the returned AuthorizationRef will grant all the rights requested when errAuthorizationSuccess is returned. If this flag is not set the operation will almost certainly succeed, but no attempt will be made to make the requested rights availible.
217    /// Call AuthorizationCopyRights to figure out which of the requested rights are granted by the returned AuthorizationRef.
218    ///
219    /// Setting the kAuthorizationFlagPartialRights flag will cause this call to succeed if only some of the requested rights are being granted by the returned AuthorizationRef. Unless this flag is set this API will fail if not all the requested rights could be obtained.
220    ///
221    /// Setting the kAuthorizationFlagDestroyRights flag will prevent any rights obtained during this call from being preserved after returning from this API (This is most useful when the authorization parameter is NULL and the caller doesn't want to affect the session state in any way).
222    ///
223    /// Setting the kAuthorizationFlagPreAuthorize flag will pre authorize the requested rights so that at a later time -- by calling AuthorizationMakeExternalForm() follow by AuthorizationCreateFromExternalForm() -- the obtained rights can be used in a different process.  Rights that can't be preauthorized will be treated as if they were authorized for the sake of returning an error (in other words if all rights are either authorized or could not be preauthorized this call will still succeed).
224    /// The rights which could not be preauthorized are not currently authorized and may fail to authorize when a later call to AuthorizationCopyRights() is made, unless the kAuthorizationFlagExtendRights and kAuthorizationFlagInteractionAllowed flags are set.  Even then they might still fail if the user does not supply the correct credentials.
225    /// The reason for passing in this flag is to provide correct audit trail information and to avoid unnecessary user interaction.
226    ///
227    ///
228    /// Parameter `rights`: (input/optional) An AuthorizationItemSet containing rights for which authorization is being requested.  If none are specified the resulting AuthorizationRef will authorize nothing at all.
229    ///
230    /// Parameter `environment`: (input/optional) An AuthorizationItemSet containing environment state used when making the autorization decision.  See the AuthorizationEnvironment type for details.
231    ///
232    /// Parameter `flags`: (input) options specified by the AuthorizationFlags enum.  set all unused bits to zero to allow for future expansion.
233    ///
234    /// Parameter `authorization`: (output optional) A pointer to an AuthorizationRef to be returned.  When the returned AuthorizationRef is no longer needed AuthorizationFree should be called to prevent anyone from using the acquired rights.  If NULL is specified no new rights are returned, but the system will attempt to authorize all the requested rights and return the appropriate status.
235    ///
236    ///
237    /// Returns: errAuthorizationSuccess 0 authorization or all requested rights succeeded.
238    ///
239    /// errAuthorizationDenied -60005 The authorization for one or more of the requested rights was denied.
240    ///
241    /// errAuthorizationCanceled -60006 The authorization was canceled by the user.
242    ///
243    /// errAuthorizationInteractionNotAllowed -60007 The authorization was denied since no interaction with the user was allowed.
244    ///
245    /// # Safety
246    ///
247    /// - `rights` must be a valid pointer or null.
248    /// - `environment` must be a valid pointer or null.
249    /// - `authorization` must be a valid pointer or null.
250    pub fn AuthorizationCreate(
251        rights: *const AuthorizationRights,
252        environment: *const AuthorizationEnvironment,
253        flags: AuthorizationFlags,
254        authorization: *mut AuthorizationRef,
255    ) -> OSStatus;
256}
257
258extern "C-unwind" {
259    /// Destroy an AutorizationRef object. If the kAuthorizationFlagDestroyRights flag is passed,
260    /// any rights associated with the authorization are lost. Otherwise, only local resources
261    /// are released, and the rights may still be available to other clients.
262    ///
263    /// Setting the kAuthorizationFlagDestroyRights flag will prevent any rights that were obtained by the specified authorization object to be preserved after returning from this API.  This effectivaly locks down all potentially shared authorizations.
264    ///
265    ///
266    /// Parameter `authorization`: (input) The authorization object on which this operation is performed.
267    ///
268    ///
269    /// Parameter `flags`: (input) Bit mask of option flags to this call.
270    ///
271    ///
272    /// Returns: errAuthorizationSuccess 0 No error.
273    ///
274    /// errAuthorizationInvalidRef -60002 The authorization parameter is invalid.
275    ///
276    /// # Safety
277    ///
278    /// `authorization` must be a valid pointer.
279    pub fn AuthorizationFree(
280        authorization: AuthorizationRef,
281        flags: AuthorizationFlags,
282    ) -> OSStatus;
283}
284
285extern "C-unwind" {
286    /// Given a set of rights, return the subset that is currently authorized
287    /// by the AuthorizationRef given.
288    ///
289    /// When the kAuthorizationFlagInteractionAllowed flag is set, user interaction will happen when required.  Failing to set this flag will result in this call failing with a errAuthorizationInteractionNotAllowed status when interaction is required.
290    ///
291    /// Setting the kAuthorizationFlagExtendRights flag will extend the currently available rights.
292    ///
293    /// Setting the kAuthorizationFlagPartialRights flag will cause this call to succeed if only some of the requested rights are being granted by the returned AuthorizationRef.  Unless this flag is set this API will fail if not all the requested rights could be obtained.
294    ///
295    /// Setting the kAuthorizationFlagDestroyRights flag will prevent any additional rights obtained during this call from being preserved after returning from this API.
296    ///
297    /// Setting the kAuthorizationFlagPreAuthorize flag will pre authorize the requested rights so that at a later time -- by calling AuthorizationMakeExternalForm() follow by AuthorizationCreateFromExternalForm() -- the obtained rights can be used in a different process.  Rights that can't be preauthorized will be treated as if they were authorized for the sake of returning an error (in other words if all rights are either authorized or could not be preauthorized this call will still succeed), and they will be returned in authorizedRights with their kAuthorizationFlagCanNotPreAuthorize bit in the flags field set to 1.
298    /// The rights which could not be preauthorized are not currently authorized and may fail to authorize when a later call to AuthorizationCopyRights() is made, unless the kAuthorizationFlagExtendRights and kAuthorizationFlagInteractionAllowed flags are set.  Even then they might still fail if the user does not supply the correct credentials.
299    /// The reason for passing in this flag is to provide correct audit trail information and to avoid unnecessary user interaction.
300    ///
301    ///
302    /// Parameter `authorization`: (input) The authorization object on which this operation is performed.
303    ///
304    /// Parameter `rights`: (input) A rights set (see AuthorizationCreate).
305    ///
306    /// Parameter `environment`: (input/optional) An AuthorizationItemSet containing environment state used when making the autorization decision.  See the AuthorizationEnvironment type for details.
307    ///
308    /// Parameter `flags`: (input) options specified by the AuthorizationFlags enum.  set all unused bits to zero to allow for future expansion.
309    ///
310    /// Parameter `authorizedRights`: (output/optional) A pointer to a newly allocated AuthorizationInfoSet in which the authorized subset of rights are returned (authorizedRights should be deallocated by calling AuthorizationFreeItemSet() when it is no longer needed).  If NULL the only information returned is the status.  Note that if the kAuthorizationFlagPreAuthorize flag was specified rights that could not be preauthorized are returned in authorizedRights, but their flags contains the kAuthorizationFlagCanNotPreAuthorize bit.
311    ///
312    ///
313    /// Returns: errAuthorizationSuccess 0 No error.
314    ///
315    /// errAuthorizationInvalidRef -60002 The authorization parameter is invalid.
316    ///
317    /// errAuthorizationInvalidSet -60001 The rights parameter is invalid.
318    ///
319    /// errAuthorizationInvalidPointer -60004 The authorizedRights parameter is invalid.
320    ///
321    /// # Safety
322    ///
323    /// - `authorization` must be a valid pointer.
324    /// - `rights` must be a valid pointer.
325    /// - `environment` must be a valid pointer or null.
326    /// - `authorized_rights` must be a valid pointer or null.
327    pub fn AuthorizationCopyRights(
328        authorization: AuthorizationRef,
329        rights: NonNull<AuthorizationRights>,
330        environment: *const AuthorizationEnvironment,
331        flags: AuthorizationFlags,
332        authorized_rights: *mut *mut AuthorizationRights,
333    ) -> OSStatus;
334}
335
336/// Callback block passed to AuthorizationCopyRightsAsync.
337///
338///
339/// Parameter `err`: (output) The result of the AuthorizationCopyRights call.
340///
341/// Parameter `blockAuthorizedRights`: (output) The authorizedRights from the AuthorizationCopyRights call to be deallocated by calling AuthorizationFreeItemSet() when it is no longer needed.
342///
343/// See also [Apple's documentation](https://developer.apple.com/documentation/security/authorizationasynccallback?language=objc)
344#[cfg(feature = "block2")]
345pub type AuthorizationAsyncCallback =
346    *mut block2::DynBlock<dyn Fn(OSStatus, *mut AuthorizationRights)>;
347
348extern "C-unwind" {
349    /// An asynchronous version of AuthorizationCopyRights.
350    ///
351    ///
352    /// Parameter `callbackBlock`: (input) The callback block to be called upon completion.
353    ///
354    /// # Safety
355    ///
356    /// - `authorization` must be a valid pointer.
357    /// - `rights` must be a valid pointer.
358    /// - `environment` must be a valid pointer or null.
359    /// - `callback_block` must be a valid pointer.
360    #[cfg(feature = "block2")]
361    pub fn AuthorizationCopyRightsAsync(
362        authorization: AuthorizationRef,
363        rights: NonNull<AuthorizationRights>,
364        environment: *const AuthorizationEnvironment,
365        flags: AuthorizationFlags,
366        callback_block: AuthorizationAsyncCallback,
367    );
368}
369
370extern "C-unwind" {
371    /// Returns sideband information (e.g. access credentials) obtained from a call to AuthorizationCreate.  The format of this data depends of the tag specified.
372    ///
373    ///
374    /// Parameter `authorization`: (input) The authorization object on which this operation is performed.
375    ///
376    /// Parameter `tag`: (input/optional) An optional string tag specifing which sideband information should be returned.  When NULL is specified all available information is returned.
377    ///
378    /// Parameter `info`: (output) A pointer to a newly allocated AuthorizationInfoSet in which the requested sideband infomation is returned (info should be deallocated by calling AuthorizationFreeItemSet() when it is no longer needed).
379    ///
380    ///
381    /// Returns: errAuthorizationSuccess 0 No error.
382    ///
383    /// errAuthorizationInvalidRef -60002 The authorization parameter is invalid.
384    ///
385    /// errAuthorizationInvalidTag -60003 The tag parameter is invalid.
386    ///
387    /// errAuthorizationInvalidPointer -60004 The info parameter is invalid.
388    ///
389    /// # Safety
390    ///
391    /// - `authorization` must be a valid pointer.
392    /// - `tag` must be a valid pointer or null.
393    /// - `info` must be a valid pointer.
394    pub fn AuthorizationCopyInfo(
395        authorization: AuthorizationRef,
396        tag: AuthorizationString,
397        info: NonNull<*mut AuthorizationItemSet>,
398    ) -> OSStatus;
399}
400
401extern "C-unwind" {
402    /// Turn an Authorization into an external "byte blob" form so it can be
403    /// transmitted to another process.
404    /// Note that *storing* the external form somewhere will probably not do what
405    /// you want, since authorizations are bounded by sessions, processes, and possibly
406    /// time limits. This is for online transmission of authorizations.
407    ///
408    ///
409    /// Parameter `authorization`: The (valid) authorization reference to externalize
410    ///
411    /// Parameter `extForm`: Pointer to an AuthorizationExternalForm variable to fill.
412    ///
413    ///
414    /// Returns: errAuthorizationSuccess 0 No error.
415    ///
416    /// errAuthorizationExternalizeNotAllowed -60009 Externalizing this authorization is not allowed.
417    ///
418    /// errAuthorizationInvalidRef -60002 The authorization parameter is invalid.
419    ///
420    /// # Safety
421    ///
422    /// - `authorization` must be a valid pointer.
423    /// - `ext_form` must be a valid pointer.
424    pub fn AuthorizationMakeExternalForm(
425        authorization: AuthorizationRef,
426        ext_form: NonNull<AuthorizationExternalForm>,
427    ) -> OSStatus;
428}
429
430extern "C-unwind" {
431    /// Internalize the external "byte blob" form of an authorization reference.
432    ///
433    ///
434    /// Parameter `extForm`: Pointer to an AuthorizationExternalForm value.
435    ///
436    /// Parameter `authorization`: Will be filled with a valid AuthorizationRef on success.
437    ///
438    ///
439    /// Returns: errAuthorizationInternalizeNotAllowed -60010 Internalizing this authorization is not allowed.
440    ///
441    /// # Safety
442    ///
443    /// - `ext_form` must be a valid pointer.
444    /// - `authorization` must be a valid pointer.
445    pub fn AuthorizationCreateFromExternalForm(
446        ext_form: NonNull<AuthorizationExternalForm>,
447        authorization: NonNull<AuthorizationRef>,
448    ) -> OSStatus;
449}
450
451extern "C-unwind" {
452    /// Release the memory allocated for an AuthorizationItemSet that was allocated
453    /// by an API call.
454    ///
455    ///
456    /// Parameter `set`: The AuthorizationItemSet to deallocate.
457    ///
458    ///
459    /// Returns: errAuthorizationSuccess 0 No error.
460    ///
461    /// errAuthorizationInvalidSet -60001 The set parameter is invalid.
462    ///
463    /// # Safety
464    ///
465    /// `set` must be a valid pointer.
466    pub fn AuthorizationFreeItemSet(set: NonNull<AuthorizationItemSet>) -> OSStatus;
467}
468
469extern "C-unwind" {
470    /// From within a tool launched via the AuthorizationExecuteWithPrivileges function
471    /// ONLY, retrieve the AuthorizationRef originally passed to that function.
472    /// While AuthorizationExecuteWithPrivileges already verified the authorization to
473    /// launch your tool, the tool may want to avail itself of any additional pre-authorizations
474    /// the caller may have obtained through that reference.
475    ///
476    ///
477    /// This function has been deprecated and should no longer be used.
478    /// Use a launchd-launched helper tool and/or the Service Mangement framework
479    /// for this functionality.
480    ///
481    /// # Safety
482    ///
483    /// `authorization` must be a valid pointer.
484    #[deprecated]
485    pub fn AuthorizationCopyPrivilegedReference(
486        authorization: NonNull<AuthorizationRef>,
487        flags: AuthorizationFlags,
488    ) -> OSStatus;
489}