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
#[cfg(any(target_os = "macos", target_os = "ios"))]
use core_foundation_sys::array::CFArrayRef;
use core_foundation_sys::base::{CFAllocatorRef, CFTypeID, OSStatus};
use core_foundation_sys::data::CFDataRef;
#[cfg(target_os = "macos")]
use core_foundation_sys::dictionary::CFDictionaryRef;
#[cfg(any(target_os = "macos", target_os = "ios"))]
use core_foundation_sys::error::CFErrorRef;
use core_foundation_sys::string::CFStringRef;
use crate::base::SecCertificateRef;
use crate::base::SecKeyRef;
extern "C" {
#[cfg(target_os = "macos")]
pub static kSecPropertyKeyType: CFStringRef;
#[cfg(target_os = "macos")]
pub static kSecPropertyKeyLabel: CFStringRef;
#[cfg(target_os = "macos")]
pub static kSecPropertyKeyLocalizedLabel: CFStringRef;
#[cfg(target_os = "macos")]
pub static kSecPropertyKeyValue: CFStringRef;
#[cfg(target_os = "macos")]
pub static kSecPropertyTypeWarning: CFStringRef;
#[cfg(target_os = "macos")]
pub static kSecPropertyTypeSuccess: CFStringRef;
#[cfg(target_os = "macos")]
pub static kSecPropertyTypeSection: CFStringRef;
#[cfg(target_os = "macos")]
pub static kSecPropertyTypeData: CFStringRef;
#[cfg(target_os = "macos")]
pub static kSecPropertyTypeString: CFStringRef;
#[cfg(target_os = "macos")]
pub static kSecPropertyTypeURL: CFStringRef;
#[cfg(target_os = "macos")]
pub static kSecPropertyTypeDate: CFStringRef;
pub fn SecCertificateGetTypeID() -> CFTypeID;
pub fn SecCertificateCreateWithData(
allocator: CFAllocatorRef,
data: CFDataRef,
) -> SecCertificateRef;
pub fn SecCertificateCopyData(certificate: SecCertificateRef) -> CFDataRef;
pub fn SecCertificateCopySubjectSummary(certificate: SecCertificateRef) -> CFStringRef;
pub fn SecCertificateCopyCommonName(
certificate: SecCertificateRef,
common_name: *mut CFStringRef,
) -> OSStatus;
pub fn SecCertificateCopyEmailAddresses(
certificate: SecCertificateRef,
email_addresses: *mut CFArrayRef,
) -> OSStatus;
#[cfg(any(feature = "OSX_10_12", target_os = "ios"))]
pub fn SecCertificateCopyNormalizedIssuerSequence(certificate: SecCertificateRef) -> CFDataRef;
#[cfg(any(feature = "OSX_10_12", target_os = "ios"))]
pub fn SecCertificateCopyNormalizedSubjectSequence(certificate: SecCertificateRef)
-> CFDataRef;
#[cfg(target_os = "macos")]
#[cfg_attr(target_arch = "aarch64", link_name = "SecCertificateCopyPublicKey$LEGACYMAC")]
#[deprecated(note = "Deprecated by Apple. May not work any more. Use SecCertificateCopyKey")]
pub fn SecCertificateCopyPublicKey(
certificate: SecCertificateRef,
key: *mut SecKeyRef,
) -> OSStatus;
#[cfg(any(feature = "OSX_10_14", target_os = "ios"))]
pub fn SecCertificateCopyKey(certificate: SecCertificateRef) -> SecKeyRef;
#[cfg(any(feature = "OSX_10_13", target_os = "ios"))]
pub fn SecCertificateCopySerialNumberData(
certificate: SecCertificateRef,
error: *mut CFErrorRef,
) -> CFDataRef;
#[cfg(target_os = "macos")]
pub fn SecCertificateCopyValues(
certificate: SecCertificateRef,
keys: CFArrayRef,
error: *mut CFErrorRef,
) -> CFDictionaryRef;
}