objc2_security/generated/SecCode.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2_core_foundation::*;
5
6use crate::*;
7
8#[cfg(feature = "CSCommon")]
9unsafe impl ConcreteType for SecCode {
10 /// Returns the type identifier of all SecCode instances.
11 #[doc(alias = "SecCodeGetTypeID")]
12 #[inline]
13 fn type_id() -> CFTypeID {
14 extern "C-unwind" {
15 fn SecCodeGetTypeID() -> CFTypeID;
16 }
17 unsafe { SecCodeGetTypeID() }
18 }
19}
20
21#[cfg(feature = "CSCommon")]
22impl SecCode {
23 /// Obtains a SecCode object for the code making the call.
24 /// The calling code is determined in a way that is subject to modification over
25 /// time, but obeys the following rules. If it is a UNIX process, its process id (pid)
26 /// is always used.
27 ///
28 ///
29 /// Parameter `flags`: Optional flags. Pass kSecCSDefaultFlags for standard behavior.
30 ///
31 /// Parameter `self`: Upon successful return, contains a SecCodeRef representing the caller.
32 ///
33 ///
34 /// Returns: Upon success, errSecSuccess. Upon error, an OSStatus value documented in
35 /// CSCommon.h or certain other Security framework headers.
36 #[doc(alias = "SecCodeCopySelf")]
37 #[cfg(feature = "CSCommon")]
38 #[inline]
39 pub unsafe fn copy_self(flags: SecCSFlags, self_: NonNull<*mut SecCode>) -> OSStatus {
40 extern "C-unwind" {
41 fn SecCodeCopySelf(flags: SecCSFlags, self_: NonNull<*mut SecCode>) -> OSStatus;
42 }
43 unsafe { SecCodeCopySelf(flags, self_) }
44 }
45}
46
47/// [Apple's documentation](https://developer.apple.com/documentation/security/kseccsuseallarchitectures?language=objc)
48pub const kSecCSUseAllArchitectures: u32 = 1;
49
50#[cfg(feature = "CSCommon")]
51impl SecCode {
52 #[doc(alias = "SecCodeCopyStaticCode")]
53 #[cfg(feature = "CSCommon")]
54 #[inline]
55 pub unsafe fn copy_static_code(
56 self: &SecCode,
57 flags: SecCSFlags,
58 static_code: NonNull<*const SecStaticCode>,
59 ) -> OSStatus {
60 extern "C-unwind" {
61 fn SecCodeCopyStaticCode(
62 code: &SecCode,
63 flags: SecCSFlags,
64 static_code: NonNull<*const SecStaticCode>,
65 ) -> OSStatus;
66 }
67 unsafe { SecCodeCopyStaticCode(self, flags, static_code) }
68 }
69
70 /// Given a SecCode object, identify the (different) SecCode object that acts
71 /// as its host. A SecCode's host acts as a supervisor and controller,
72 /// and is the ultimate authority on the its dynamic validity and status.
73 /// The host relationship is securely established (absent reported errors).
74 ///
75 ///
76 /// Parameter `guest`: A valid SecCode object reference representing code running
77 /// on the system.
78 ///
79 /// Parameter `flags`: Optional flags. Pass kSecCSDefaultFlags for standard behavior.
80 ///
81 /// Parameter `host`: On successful return, a SecCode object reference identifying
82 /// the code's host.
83 ///
84 /// Returns: Upon success, errSecSuccess. Upon error, an OSStatus value documented in
85 /// CSCommon.h or certain other Security framework headers.
86 #[doc(alias = "SecCodeCopyHost")]
87 #[cfg(feature = "CSCommon")]
88 #[inline]
89 pub unsafe fn copy_host(
90 self: &SecCode,
91 flags: SecCSFlags,
92 host: NonNull<*mut SecCode>,
93 ) -> OSStatus {
94 extern "C-unwind" {
95 fn SecCodeCopyHost(
96 guest: &SecCode,
97 flags: SecCSFlags,
98 host: NonNull<*mut SecCode>,
99 ) -> OSStatus;
100 }
101 unsafe { SecCodeCopyHost(self, flags, host) }
102 }
103}
104
105extern "C" {
106 /// [Apple's documentation](https://developer.apple.com/documentation/security/ksecguestattributecanonical?language=objc)
107 pub static kSecGuestAttributeCanonical: &'static CFString;
108}
109
110extern "C" {
111 /// [Apple's documentation](https://developer.apple.com/documentation/security/ksecguestattributehash?language=objc)
112 pub static kSecGuestAttributeHash: &'static CFString;
113}
114
115extern "C" {
116 /// [Apple's documentation](https://developer.apple.com/documentation/security/ksecguestattributemachport?language=objc)
117 pub static kSecGuestAttributeMachPort: &'static CFString;
118}
119
120extern "C" {
121 /// [Apple's documentation](https://developer.apple.com/documentation/security/ksecguestattributepid?language=objc)
122 pub static kSecGuestAttributePid: &'static CFString;
123}
124
125extern "C" {
126 /// [Apple's documentation](https://developer.apple.com/documentation/security/ksecguestattributeaudit?language=objc)
127 pub static kSecGuestAttributeAudit: &'static CFString;
128}
129
130extern "C" {
131 /// [Apple's documentation](https://developer.apple.com/documentation/security/ksecguestattributedynamiccode?language=objc)
132 pub static kSecGuestAttributeDynamicCode: &'static CFString;
133}
134
135extern "C" {
136 /// [Apple's documentation](https://developer.apple.com/documentation/security/ksecguestattributedynamiccodeinfoplist?language=objc)
137 pub static kSecGuestAttributeDynamicCodeInfoPlist: &'static CFString;
138}
139
140extern "C" {
141 /// [Apple's documentation](https://developer.apple.com/documentation/security/ksecguestattributearchitecture?language=objc)
142 pub static kSecGuestAttributeArchitecture: &'static CFString;
143}
144
145extern "C" {
146 /// [Apple's documentation](https://developer.apple.com/documentation/security/ksecguestattributesubarchitecture?language=objc)
147 pub static kSecGuestAttributeSubarchitecture: &'static CFString;
148}
149
150#[cfg(feature = "CSCommon")]
151impl SecCode {
152 /// This is the omnibus API function for obtaining dynamic code references.
153 /// In general, it asks a particular code acting as a code host to locate
154 /// and return a guest with given attributes. Different hosts support
155 /// different combinations of attributes and values for guest selection.
156 ///
157 /// Asking the NULL host invokes system default procedures for obtaining
158 /// any running code in the system with the attributes given. The returned
159 /// code may be anywhere in the system.
160 ///
161 /// The methods a host uses to identify, separate, and control its guests
162 /// are specific to each type of host. This call provides a generic abstraction layer
163 /// that allows uniform interrogation of all hosts. A SecCode that does not
164 /// act as a host will always return errSecCSNoSuchCode. A SecCode that does
165 /// support hosting may return itself to signify that the attribute refers to
166 /// itself rather than one of its hosts.
167 ///
168 ///
169 /// Parameter `host`: A valid SecCode object reference representing code running
170 /// on the system that acts as a Code Signing host. As a special case, passing
171 /// NULL indicates that the Code Signing root of trust should be used as a starting
172 /// point. Currently, that is the system kernel.
173 ///
174 /// Parameter `attributes`: A CFDictionary containing zero or more attribute selector
175 /// values. Each selector has a CFString key and associated CFTypeRef value.
176 /// The key name identifies the attribute being specified; the associated value,
177 /// whose type depends on the the key name, selects a particular value or other
178 /// constraint on that attribute. Each host only supports particular combinations
179 /// of keys and values, and errors will be returned if any unsupported set is requested.
180 /// As a special case, NULL is taken to mean an empty attribute set.
181 /// Note that some hosts that support hosting chains (guests being hosts)
182 /// may return sub-guests in this call. In other words, do not assume that
183 /// a SecCodeRef returned by this call is a direct guest of the queried host
184 /// (though it will be a proximate guest, i.e. a guest's guest some way down).
185 /// Asking the NULL host for NULL attributes returns a code reference for the system root
186 /// of trust (at present, the running Darwin kernel).
187 ///
188 /// Parameter `flags`: Optional flags. Pass kSecCSDefaultFlags for standard behavior.
189 ///
190 /// Parameter `guest`: On successful return, a SecCode object reference identifying
191 /// the particular guest of the host that owns the attribute value(s) specified.
192 /// This argument will not be changed if the call fails (does not return errSecSuccess).
193 ///
194 /// Returns: Upon success, errSecSuccess. Upon error, an OSStatus value documented in
195 /// CSCommon.h or certain other Security framework headers. In particular:
196 /// errSecCSUnsupportedGuestAttributes The host does not support the attribute
197 /// type given by attributeType.
198 /// errSecCSInvalidAttributeValues The type of value given for a guest
199 /// attribute is not supported by the host.
200 /// errSecCSNoSuchCode The host has no guest with the attribute value given
201 /// by attributeValue, even though the value is of a supported type. This may also
202 /// be returned if the host code does not currently act as a Code Signing host.
203 /// errSecCSNotAHost The specified host cannot, in fact, act as a code
204 /// host. (It is missing the kSecCodeSignatureHost option flag in its code
205 /// signature.)
206 /// errSecCSMultipleGuests The attributes specified do not uniquely identify
207 /// a guest (the specification is ambiguous).
208 #[doc(alias = "SecCodeCopyGuestWithAttributes")]
209 #[cfg(feature = "CSCommon")]
210 #[inline]
211 pub unsafe fn copy_guest_with_attributes(
212 host: Option<&SecCode>,
213 attributes: Option<&CFDictionary>,
214 flags: SecCSFlags,
215 guest: NonNull<*mut SecCode>,
216 ) -> OSStatus {
217 extern "C-unwind" {
218 fn SecCodeCopyGuestWithAttributes(
219 host: Option<&SecCode>,
220 attributes: Option<&CFDictionary>,
221 flags: SecCSFlags,
222 guest: NonNull<*mut SecCode>,
223 ) -> OSStatus;
224 }
225 unsafe { SecCodeCopyGuestWithAttributes(host, attributes, flags, guest) }
226 }
227
228 /// Performs dynamic validation of the given SecCode object. The call obtains and
229 /// verifies the signature on the code object. It checks the validity of only those
230 /// sealed components required to establish identity. It checks the SecCode's
231 /// dynamic validity status as reported by its host. It ensures that the SecCode's
232 /// host is in turn valid. Finally, it validates the code against a SecRequirement
233 /// if one is given. The call succeeds if all these conditions are satisfactory.
234 /// It fails otherwise.
235 ///
236 /// This call is secure against attempts to modify the file system source of the
237 /// SecCode.
238 ///
239 ///
240 /// Parameter `code`: The code object to be validated.
241 ///
242 /// Parameter `flags`: Optional flags. Pass kSecCSDefaultFlags for standard behavior.
243 ///
244 /// Parameter `requirement`: An optional code requirement specifying additional conditions
245 /// the code object must satisfy to be considered valid. If NULL, no additional
246 /// requirements are imposed.
247 ///
248 /// Returns: If validation passes, errSecSuccess. If validation fails, an OSStatus value
249 /// documented in CSCommon.h or certain other Security framework headers.
250 #[doc(alias = "SecCodeCheckValidity")]
251 #[cfg(feature = "CSCommon")]
252 #[inline]
253 pub unsafe fn check_validity(
254 self: &SecCode,
255 flags: SecCSFlags,
256 requirement: Option<&SecRequirement>,
257 ) -> OSStatus {
258 extern "C-unwind" {
259 fn SecCodeCheckValidity(
260 code: &SecCode,
261 flags: SecCSFlags,
262 requirement: Option<&SecRequirement>,
263 ) -> OSStatus;
264 }
265 unsafe { SecCodeCheckValidity(self, flags, requirement) }
266 }
267
268 /// Performs dynamic validation of the given SecCode object. The call obtains and
269 /// verifies the signature on the code object. It checks the validity of only those
270 /// sealed components required to establish identity. It checks the SecCode's
271 /// dynamic validity status as reported by its host. It ensures that the SecCode's
272 /// host is in turn valid. Finally, it validates the code against a SecRequirement
273 /// if one is given. The call succeeds if all these conditions are satisfactory.
274 /// It fails otherwise.
275 ///
276 /// This call is secure against attempts to modify the file system source of the
277 /// SecCode.
278 ///
279 ///
280 /// Parameter `code`: The code object to be validated.
281 ///
282 /// Parameter `flags`: Optional flags. Pass kSecCSDefaultFlags for standard behavior.
283 ///
284 /// Parameter `requirement`: An optional code requirement specifying additional conditions
285 /// the code object must satisfy to be considered valid. If NULL, no additional
286 /// requirements are imposed.
287 ///
288 /// Parameter `errors`: An optional pointer to a CFErrorRef variable. If the call fails
289 /// (and something other than errSecSuccess is returned), and this argument is non-NULL,
290 /// a CFErrorRef is stored there further describing the nature and circumstances
291 /// of the failure. The caller must CFRelease() this error object when done with it.
292 ///
293 /// Returns: If validation passes, errSecSuccess. If validation fails, an OSStatus value
294 /// documented in CSCommon.h or certain other Security framework headers.
295 #[doc(alias = "SecCodeCheckValidityWithErrors")]
296 #[cfg(feature = "CSCommon")]
297 #[inline]
298 pub unsafe fn check_validity_with_errors(
299 self: &SecCode,
300 flags: SecCSFlags,
301 requirement: Option<&SecRequirement>,
302 errors: *mut *mut CFError,
303 ) -> OSStatus {
304 extern "C-unwind" {
305 fn SecCodeCheckValidityWithErrors(
306 code: &SecCode,
307 flags: SecCSFlags,
308 requirement: Option<&SecRequirement>,
309 errors: *mut *mut CFError,
310 ) -> OSStatus;
311 }
312 unsafe { SecCodeCheckValidityWithErrors(self, flags, requirement, errors) }
313 }
314
315 /// For a SecStaticCodeRef, check that a given CFData object faithfully represents
316 /// a plain-file resource in its resource seal.
317 /// This call will fail if the file is missing in the bundle, even if it is optional.
318 ///
319 ///
320 /// Parameter `code`: A code or StaticCode object.
321 ///
322 /// Parameter `relativePath`: A CFStringRef containing the relative path to a sealed resource
323 /// file. This path is relative to the resource base, which is either Contents or
324 /// the bundle root, depending on bundle format.
325 ///
326 /// Parameter `fileData`: A CFDataRef containing the exact contents of that resource file.
327 ///
328 /// Parameter `flags`: Pass kSecCSDefaultFlags.
329 ///
330 /// Returns: noErr if fileData is the exact content of the file at relativePath at the
331 /// time it was signed. Various error codes if it is different, there was no such file,
332 /// it was not a plain file, or anything is irregular.
333 #[doc(alias = "SecCodeValidateFileResource")]
334 #[cfg(feature = "CSCommon")]
335 #[inline]
336 pub unsafe fn validate_file_resource(
337 code: &SecStaticCode,
338 relative_path: &CFString,
339 file_data: &CFData,
340 flags: SecCSFlags,
341 ) -> OSStatus {
342 extern "C-unwind" {
343 fn SecCodeValidateFileResource(
344 code: &SecStaticCode,
345 relative_path: &CFString,
346 file_data: &CFData,
347 flags: SecCSFlags,
348 ) -> OSStatus;
349 }
350 unsafe { SecCodeValidateFileResource(code, relative_path, file_data, flags) }
351 }
352
353 /// For a given Code or StaticCode object, returns a URL to a location on disk where the
354 /// code object can be found. For single files, the URL points to that file.
355 /// For bundles, it points to the directory containing the entire bundle.
356 ///
357 ///
358 /// Parameter `staticCode`: The Code or StaticCode object to be located. For a Code
359 /// argument, its StaticCode is processed as per SecCodeCopyStaticCode.
360 ///
361 /// Parameter `flags`: Optional flags. Pass kSecCSDefaultFlags for standard behavior.
362 ///
363 /// Parameter `path`: On successful return, contains a CFURL identifying the location
364 /// on disk of the staticCode object.
365 ///
366 /// Returns: On success, errSecSuccess. On error, an OSStatus value
367 /// documented in CSCommon.h or certain other Security framework headers.
368 #[doc(alias = "SecCodeCopyPath")]
369 #[cfg(feature = "CSCommon")]
370 #[inline]
371 pub unsafe fn copy_path(
372 static_code: &SecStaticCode,
373 flags: SecCSFlags,
374 path: NonNull<*const CFURL>,
375 ) -> OSStatus {
376 extern "C-unwind" {
377 fn SecCodeCopyPath(
378 static_code: &SecStaticCode,
379 flags: SecCSFlags,
380 path: NonNull<*const CFURL>,
381 ) -> OSStatus;
382 }
383 unsafe { SecCodeCopyPath(static_code, flags, path) }
384 }
385
386 /// For a given Code or StaticCode object, determines its Designated Code Requirement.
387 /// The Designated Requirement is the SecRequirement that the code believes
388 /// should be used to properly identify it in the future.
389 ///
390 /// If the SecCode contains an explicit Designated Requirement, a copy of that
391 /// is returned. If it does not, a SecRequirement is implicitly constructed from
392 /// its signing authority and its embedded unique identifier. No Designated
393 /// Requirement can be obtained from code that is unsigned. Code that is modified
394 /// after signature, improperly signed, or has become invalid, may or may not yield
395 /// a Designated Requirement. This call does not validate the SecStaticCode argument.
396 ///
397 ///
398 /// Parameter `code`: The Code or StaticCode object to be interrogated. For a Code
399 /// argument, its StaticCode is processed as per SecCodeCopyStaticCode.
400 ///
401 /// Parameter `flags`: Optional flags. Pass kSecCSDefaultFlags for standard behavior.
402 ///
403 /// Parameter `requirement`: On successful return, contains a copy of a SecRequirement
404 /// object representing the code's Designated Requirement. On error, unchanged.
405 ///
406 /// Returns: On success, errSecSuccess. On error, an OSStatus value
407 /// documented in CSCommon.h or certain other Security framework headers.
408 #[doc(alias = "SecCodeCopyDesignatedRequirement")]
409 #[cfg(feature = "CSCommon")]
410 #[inline]
411 pub unsafe fn copy_designated_requirement(
412 code: &SecStaticCode,
413 flags: SecCSFlags,
414 requirement: NonNull<*mut SecRequirement>,
415 ) -> OSStatus {
416 extern "C-unwind" {
417 fn SecCodeCopyDesignatedRequirement(
418 code: &SecStaticCode,
419 flags: SecCSFlags,
420 requirement: NonNull<*mut SecRequirement>,
421 ) -> OSStatus;
422 }
423 unsafe { SecCodeCopyDesignatedRequirement(code, flags, requirement) }
424 }
425}
426
427/// [Apple's documentation](https://developer.apple.com/documentation/security/kseccsinternalinformation?language=objc)
428pub const kSecCSInternalInformation: u32 = 1;
429/// [Apple's documentation](https://developer.apple.com/documentation/security/kseccssigninginformation?language=objc)
430pub const kSecCSSigningInformation: u32 = 2;
431/// [Apple's documentation](https://developer.apple.com/documentation/security/kseccsrequirementinformation?language=objc)
432pub const kSecCSRequirementInformation: u32 = 4;
433/// [Apple's documentation](https://developer.apple.com/documentation/security/kseccsdynamicinformation?language=objc)
434pub const kSecCSDynamicInformation: u32 = 8;
435/// [Apple's documentation](https://developer.apple.com/documentation/security/kseccscontentinformation?language=objc)
436pub const kSecCSContentInformation: u32 = 16;
437/// [Apple's documentation](https://developer.apple.com/documentation/security/kseccsskipresourcedirectory?language=objc)
438pub const kSecCSSkipResourceDirectory: u32 = 32;
439/// [Apple's documentation](https://developer.apple.com/documentation/security/kseccscalculatecmsdigest?language=objc)
440pub const kSecCSCalculateCMSDigest: u32 = 64;
441
442extern "C" {
443 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfocertificates?language=objc)
444 pub static kSecCodeInfoCertificates: &'static CFString;
445}
446
447extern "C" {
448 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfochangedfiles?language=objc)
449 pub static kSecCodeInfoChangedFiles: &'static CFString;
450}
451
452extern "C" {
453 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfocms?language=objc)
454 pub static kSecCodeInfoCMS: &'static CFString;
455}
456
457extern "C" {
458 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfodesignatedrequirement?language=objc)
459 pub static kSecCodeInfoDesignatedRequirement: &'static CFString;
460}
461
462extern "C" {
463 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfoentitlements?language=objc)
464 pub static kSecCodeInfoEntitlements: &'static CFString;
465}
466
467extern "C" {
468 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfoentitlementsdict?language=objc)
469 pub static kSecCodeInfoEntitlementsDict: &'static CFString;
470}
471
472extern "C" {
473 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfoflags?language=objc)
474 pub static kSecCodeInfoFlags: &'static CFString;
475}
476
477extern "C" {
478 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfoformat?language=objc)
479 pub static kSecCodeInfoFormat: &'static CFString;
480}
481
482extern "C" {
483 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfodigestalgorithm?language=objc)
484 pub static kSecCodeInfoDigestAlgorithm: &'static CFString;
485}
486
487extern "C" {
488 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfodigestalgorithms?language=objc)
489 pub static kSecCodeInfoDigestAlgorithms: &'static CFString;
490}
491
492extern "C" {
493 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfoplatformidentifier?language=objc)
494 pub static kSecCodeInfoPlatformIdentifier: &'static CFString;
495}
496
497extern "C" {
498 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfoidentifier?language=objc)
499 pub static kSecCodeInfoIdentifier: &'static CFString;
500}
501
502extern "C" {
503 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfoimplicitdesignatedrequirement?language=objc)
504 pub static kSecCodeInfoImplicitDesignatedRequirement: &'static CFString;
505}
506
507extern "C" {
508 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfodefaultdesignatedlightweightcoderequirement?language=objc)
509 pub static kSecCodeInfoDefaultDesignatedLightweightCodeRequirement: &'static CFString;
510}
511
512extern "C" {
513 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfomainexecutable?language=objc)
514 pub static kSecCodeInfoMainExecutable: &'static CFString;
515}
516
517extern "C" {
518 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfoplist?language=objc)
519 pub static kSecCodeInfoPList: &'static CFString;
520}
521
522extern "C" {
523 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinforequirements?language=objc)
524 pub static kSecCodeInfoRequirements: &'static CFString;
525}
526
527extern "C" {
528 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinforequirementdata?language=objc)
529 pub static kSecCodeInfoRequirementData: &'static CFString;
530}
531
532extern "C" {
533 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfosource?language=objc)
534 pub static kSecCodeInfoSource: &'static CFString;
535}
536
537extern "C" {
538 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfostatus?language=objc)
539 pub static kSecCodeInfoStatus: &'static CFString;
540}
541
542extern "C" {
543 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfoteamidentifier?language=objc)
544 pub static kSecCodeInfoTeamIdentifier: &'static CFString;
545}
546
547extern "C" {
548 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfotime?language=objc)
549 pub static kSecCodeInfoTime: &'static CFString;
550}
551
552extern "C" {
553 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfotimestamp?language=objc)
554 pub static kSecCodeInfoTimestamp: &'static CFString;
555}
556
557extern "C" {
558 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfotrust?language=objc)
559 pub static kSecCodeInfoTrust: &'static CFString;
560}
561
562extern "C" {
563 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfounique?language=objc)
564 pub static kSecCodeInfoUnique: &'static CFString;
565}
566
567extern "C" {
568 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfocdhashes?language=objc)
569 pub static kSecCodeInfoCdHashes: &'static CFString;
570}
571
572extern "C" {
573 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinforuntimeversion?language=objc)
574 pub static kSecCodeInfoRuntimeVersion: &'static CFString;
575}
576
577extern "C" {
578 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccodeinfostaplednotarizationticket?language=objc)
579 pub static kSecCodeInfoStapledNotarizationTicket: &'static CFString;
580}
581
582#[cfg(feature = "CSCommon")]
583impl SecCode {
584 #[doc(alias = "SecCodeCopySigningInformation")]
585 #[cfg(feature = "CSCommon")]
586 #[inline]
587 pub unsafe fn copy_signing_information(
588 code: &SecStaticCode,
589 flags: SecCSFlags,
590 information: NonNull<*const CFDictionary>,
591 ) -> OSStatus {
592 extern "C-unwind" {
593 fn SecCodeCopySigningInformation(
594 code: &SecStaticCode,
595 flags: SecCSFlags,
596 information: NonNull<*const CFDictionary>,
597 ) -> OSStatus;
598 }
599 unsafe { SecCodeCopySigningInformation(code, flags, information) }
600 }
601
602 #[doc(alias = "SecCodeMapMemory")]
603 #[cfg(feature = "CSCommon")]
604 #[inline]
605 pub unsafe fn map_memory(code: &SecStaticCode, flags: SecCSFlags) -> OSStatus {
606 extern "C-unwind" {
607 fn SecCodeMapMemory(code: &SecStaticCode, flags: SecCSFlags) -> OSStatus;
608 }
609 unsafe { SecCodeMapMemory(code, flags) }
610 }
611}
612
613extern "C-unwind" {
614 #[cfg(feature = "CSCommon")]
615 #[deprecated = "renamed to `SecCode::copy_self`"]
616 pub fn SecCodeCopySelf(flags: SecCSFlags, self_: NonNull<*mut SecCode>) -> OSStatus;
617}
618
619extern "C-unwind" {
620 #[cfg(feature = "CSCommon")]
621 #[deprecated = "renamed to `SecCode::copy_static_code`"]
622 pub fn SecCodeCopyStaticCode(
623 code: &SecCode,
624 flags: SecCSFlags,
625 static_code: NonNull<*const SecStaticCode>,
626 ) -> OSStatus;
627}
628
629extern "C-unwind" {
630 #[cfg(feature = "CSCommon")]
631 #[deprecated = "renamed to `SecCode::copy_host`"]
632 pub fn SecCodeCopyHost(
633 guest: &SecCode,
634 flags: SecCSFlags,
635 host: NonNull<*mut SecCode>,
636 ) -> OSStatus;
637}
638
639extern "C-unwind" {
640 #[cfg(feature = "CSCommon")]
641 #[deprecated = "renamed to `SecCode::copy_guest_with_attributes`"]
642 pub fn SecCodeCopyGuestWithAttributes(
643 host: Option<&SecCode>,
644 attributes: Option<&CFDictionary>,
645 flags: SecCSFlags,
646 guest: NonNull<*mut SecCode>,
647 ) -> OSStatus;
648}
649
650extern "C-unwind" {
651 #[cfg(feature = "CSCommon")]
652 #[deprecated = "renamed to `SecCode::check_validity`"]
653 pub fn SecCodeCheckValidity(
654 code: &SecCode,
655 flags: SecCSFlags,
656 requirement: Option<&SecRequirement>,
657 ) -> OSStatus;
658}
659
660extern "C-unwind" {
661 #[cfg(feature = "CSCommon")]
662 #[deprecated = "renamed to `SecCode::check_validity_with_errors`"]
663 pub fn SecCodeCheckValidityWithErrors(
664 code: &SecCode,
665 flags: SecCSFlags,
666 requirement: Option<&SecRequirement>,
667 errors: *mut *mut CFError,
668 ) -> OSStatus;
669}
670
671extern "C-unwind" {
672 #[cfg(feature = "CSCommon")]
673 #[deprecated = "renamed to `SecCode::validate_file_resource`"]
674 pub fn SecCodeValidateFileResource(
675 code: &SecStaticCode,
676 relative_path: &CFString,
677 file_data: &CFData,
678 flags: SecCSFlags,
679 ) -> OSStatus;
680}
681
682extern "C-unwind" {
683 #[cfg(feature = "CSCommon")]
684 #[deprecated = "renamed to `SecCode::copy_path`"]
685 pub fn SecCodeCopyPath(
686 static_code: &SecStaticCode,
687 flags: SecCSFlags,
688 path: NonNull<*const CFURL>,
689 ) -> OSStatus;
690}
691
692extern "C-unwind" {
693 #[cfg(feature = "CSCommon")]
694 #[deprecated = "renamed to `SecCode::copy_designated_requirement`"]
695 pub fn SecCodeCopyDesignatedRequirement(
696 code: &SecStaticCode,
697 flags: SecCSFlags,
698 requirement: NonNull<*mut SecRequirement>,
699 ) -> OSStatus;
700}
701
702extern "C-unwind" {
703 #[cfg(feature = "CSCommon")]
704 #[deprecated = "renamed to `SecCode::copy_signing_information`"]
705 pub fn SecCodeCopySigningInformation(
706 code: &SecStaticCode,
707 flags: SecCSFlags,
708 information: NonNull<*const CFDictionary>,
709 ) -> OSStatus;
710}
711
712extern "C-unwind" {
713 #[cfg(feature = "CSCommon")]
714 #[deprecated = "renamed to `SecCode::map_memory`"]
715 pub fn SecCodeMapMemory(code: &SecStaticCode, flags: SecCSFlags) -> OSStatus;
716}