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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2_core_foundation::*;
use crate::*;
extern "C" {
/// Specifies an MD2 digest
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecdigestmd2?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecDigestMD2: &'static CFString;
}
extern "C" {
/// Specifies an MD4 digest
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecdigestmd4?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecDigestMD4: &'static CFString;
}
extern "C" {
/// Specifies an MD5 digest
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecdigestmd5?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecDigestMD5: &'static CFString;
}
extern "C" {
/// Specifies a SHA1 digest
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecdigestsha1?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecDigestSHA1: &'static CFString;
}
extern "C" {
/// Specifies a SHA2 digest.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecdigestsha2?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecDigestSHA2: &'static CFString;
}
extern "C" {
/// Specifies an HMAC using the MD5 digest algorithm.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecdigesthmacmd5?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecDigestHMACMD5: &'static CFString;
}
extern "C" {
/// Specifies an HMAC using the SHA1 digest algorithm.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecdigesthmacsha1?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecDigestHMACSHA1: &'static CFString;
}
extern "C" {
/// Specifies an HMAC using one of the SHA2 digest algorithms.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecdigesthmacsha2?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecDigestHMACSHA2: &'static CFString;
}
extern "C" {
/// Used with SecTransformGetAttribute to query the attribute type.
/// Returns one of the strings defined in the previous section.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecdigesttypeattribute?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecDigestTypeAttribute: &'static CFString;
}
extern "C" {
/// Used with SecTransformGetAttribute to query the length attribute.
/// Returns a CFNumberRef that contains the length in bytes.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecdigestlengthattribute?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecDigestLengthAttribute: &'static CFString;
}
extern "C" {
/// When set and used with one of the HMAC digest types, sets the key
/// for the HMAC operation. The data type for this attribute must be
/// a CFDataRef. If this value is not set, the transform will assume
/// a zero length key.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecdigesthmackeyattribute?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecDigestHMACKeyAttribute: &'static CFString;
}
/// Creates a digest computation object.
///
/// Parameter `digestType`: The type of digest to compute. You may pass NULL
/// for this parameter, in which case an appropriate
/// algorithm will be chosen for you.
///
/// Parameter `digestLength`: The desired digest length. Note that certain
/// algorithms may only support certain sizes. You may
/// pass 0 for this parameter, in which case an
/// appropriate length will be chosen for you.
///
/// Parameter `error`: A pointer to a CFErrorRef. This pointer will be set
/// if an error occurred. This value may be NULL if you
/// do not want an error returned.
///
/// Returns: A pointer to a SecTransformRef object. This object must
/// be released with CFRelease when you are done with
/// it. This function will return NULL if an error
/// occurred.
///
/// This function creates a transform which computes a
/// cryptographic digest.
///
/// # Safety
///
/// - `digest_type` should be of the correct type.
/// - `error` must be a valid pointer or null.
#[cfg(feature = "SecTransform")]
#[deprecated = "SecTransform is no longer supported"]
#[inline]
pub unsafe extern "C-unwind" fn SecDigestTransformCreate(
digest_type: Option<&CFType>,
digest_length: CFIndex,
error: *mut *mut CFError,
) -> CFRetained<SecTransform> {
extern "C-unwind" {
fn SecDigestTransformCreate(
digest_type: Option<&CFType>,
digest_length: CFIndex,
error: *mut *mut CFError,
) -> Option<NonNull<SecTransform>>;
}
let ret = unsafe { SecDigestTransformCreate(digest_type, digest_length, error) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
/// Return the CFTypeID of a SecDigestTransform
///
/// Returns: The CFTypeID
#[deprecated = "SecTransform is no longer supported"]
#[inline]
pub extern "C-unwind" fn SecDigestTransformGetTypeID() -> CFTypeID {
extern "C-unwind" {
fn SecDigestTransformGetTypeID() -> CFTypeID;
}
unsafe { SecDigestTransformGetTypeID() }
}