1 use core_foundation_sys::array::CFArrayRef;
2 use core_foundation_sys::base::{CFAllocatorRef, CFTypeID, OSStatus};
3 use core_foundation_sys::data::CFDataRef;
4 use core_foundation_sys::dictionary::CFDictionaryRef;
5 use core_foundation_sys::error::CFErrorRef;
6 use core_foundation_sys::string::CFStringRef;
7 
8 use crate::base::{SecCertificateRef, SecKeyRef};
9 
10 extern "C" {
11     #[cfg(target_os = "macos")]
12     pub static kSecPropertyKeyType: CFStringRef;
13     #[cfg(target_os = "macos")]
14     pub static kSecPropertyKeyLabel: CFStringRef;
15     #[cfg(target_os = "macos")]
16     pub static kSecPropertyKeyLocalizedLabel: CFStringRef;
17     #[cfg(target_os = "macos")]
18     pub static kSecPropertyKeyValue: CFStringRef;
19 
20     #[cfg(target_os = "macos")]
21     pub static kSecPropertyTypeWarning: CFStringRef;
22     #[cfg(target_os = "macos")]
23     pub static kSecPropertyTypeSuccess: CFStringRef;
24     #[cfg(target_os = "macos")]
25     pub static kSecPropertyTypeSection: CFStringRef;
26     #[cfg(target_os = "macos")]
27     pub static kSecPropertyTypeData: CFStringRef;
28     #[cfg(target_os = "macos")]
29     pub static kSecPropertyTypeString: CFStringRef;
30     #[cfg(target_os = "macos")]
31     pub static kSecPropertyTypeURL: CFStringRef;
32     #[cfg(target_os = "macos")]
33     pub static kSecPropertyTypeDate: CFStringRef;
34 
SecCertificateGetTypeID() -> CFTypeID35     pub fn SecCertificateGetTypeID() -> CFTypeID;
SecCertificateCreateWithData( allocator: CFAllocatorRef, data: CFDataRef, ) -> SecCertificateRef36     pub fn SecCertificateCreateWithData(
37         allocator: CFAllocatorRef,
38         data: CFDataRef,
39     ) -> SecCertificateRef;
SecCertificateCopyData(certificate: SecCertificateRef) -> CFDataRef40     pub fn SecCertificateCopyData(certificate: SecCertificateRef) -> CFDataRef;
SecCertificateCopySubjectSummary(certificate: SecCertificateRef) -> CFStringRef41     pub fn SecCertificateCopySubjectSummary(certificate: SecCertificateRef) -> CFStringRef;
SecCertificateCopyCommonName( certificate: SecCertificateRef, common_name: *mut CFStringRef, ) -> OSStatus42     pub fn SecCertificateCopyCommonName(
43         certificate: SecCertificateRef,
44         common_name: *mut CFStringRef,
45     ) -> OSStatus;
46     #[cfg(target_os = "macos")]
SecCertificateCopyPublicKey( certificate: SecCertificateRef, key: *mut SecKeyRef, ) -> OSStatus47     pub fn SecCertificateCopyPublicKey(
48         certificate: SecCertificateRef,
49         key: *mut SecKeyRef,
50     ) -> OSStatus;
51     #[cfg(target_os = "macos")]
SecCertificateCopyValues( certificate: SecCertificateRef, keys: CFArrayRef, error: *mut CFErrorRef, ) -> CFDictionaryRef52     pub fn SecCertificateCopyValues(
53         certificate: SecCertificateRef,
54         keys: CFArrayRef,
55         error: *mut CFErrorRef,
56     ) -> CFDictionaryRef;
57 }
58