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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
//! 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" {
/// Indicates that no padding will be used when encrypting or decrypting.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecpaddingnonekey?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecPaddingNoneKey: &'static CFString;
}
extern "C" {
/// Indicates that PKCS1 padding will be used when encrypting or decrypting.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecpaddingpkcs1key?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecPaddingPKCS1Key: &'static CFString;
}
extern "C" {
/// Indicates that PKCS5 padding will be used when encrypting or decrypting.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecpaddingpkcs5key?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecPaddingPKCS5Key: &'static CFString;
}
extern "C" {
/// Indicates that PKCS7 padding will be used when encrypting or decrypting.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecpaddingpkcs7key?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecPaddingPKCS7Key: &'static CFString;
}
extern "C" {
/// Indicates that PKCS7 padding will be used when encrypting or decrypting.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecpaddingoaepkey?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecPaddingOAEPKey: &'static CFString;
}
extern "C" {
/// Indicates that no mode will be used when encrypting or decrypting.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecmodenonekey?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecModeNoneKey: &'static CFString;
}
extern "C" {
/// Indicates that ECB mode will be used when encrypting or decrypting.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecmodeecbkey?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecModeECBKey: &'static CFString;
}
extern "C" {
/// Indicates that CBC mode will be used when encrypting or decrypting.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecmodecbckey?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecModeCBCKey: &'static CFString;
}
extern "C" {
/// Indicates that CFB mode will be used when encrypting or decrypting.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecmodecfbkey?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecModeCFBKey: &'static CFString;
}
extern "C" {
/// Indicates that OFB mode will be used when encrypting or decrypting.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecmodeofbkey?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecModeOFBKey: &'static CFString;
}
extern "C" {
/// This attribute holds the encryption key for the transform. (ReadOnly)
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecencryptkey?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecEncryptKey: &'static CFString;
}
extern "C" {
/// Key for setting padding.
///
/// This key is optional. If you do not supply a value for this key,
/// an appropriate value will be supplied for you.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecpaddingkey?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecPaddingKey: &'static CFString;
}
extern "C" {
/// Key for setting an initialization vector.
///
/// This key is optional. If you do not supply a
/// value for this key, an appropriate value will be supplied for you.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecivkey?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecIVKey: &'static CFString;
}
extern "C" {
/// Specifies the encryption mode.
///
/// This key is optional. If you do not supply this key,
/// an appropriate value will be supplied for you.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecencryptionmode?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecEncryptionMode: &'static CFString;
}
extern "C" {
/// Specifies the OAEP message length.
///
/// This should be set to a CFNumberRef when the padding is set to OAEP,
/// and a specific messages size is desired. If unset the minimum padding
/// will be added. It is ignored when the padding mode is not OAEP.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecoaepmessagelengthattributename?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecOAEPMessageLengthAttributeName: &'static CFString;
}
extern "C" {
/// Specifies the OAEP encoding paramaters
///
/// This should be set to a CFDataRef when the padding is set to OAEP.
/// If unset a zero length CFDataRef is used. It is ignored by non
/// OAEP padding modes.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecoaepencodingparametersattributename?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecOAEPEncodingParametersAttributeName: &'static CFString;
}
extern "C" {
/// Specifies the OAEP MGF1 digest algorithm.
///
/// This should be set to a digest algorithm when the padding is set to OAEP.
/// If unset SHA1 is used. It is ifnored by non OAEP padding modes.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecoaepmgf1digestalgorithmattributename?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecOAEPMGF1DigestAlgorithmAttributeName: &'static CFString;
}
/// Creates an encryption SecTransform object.
///
/// Parameter `keyRef`: The key for the encryption operation
///
/// 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 encrypts data.
///
/// # Safety
///
/// `error` must be a valid pointer or null.
#[cfg(all(feature = "SecBase", feature = "SecTransform"))]
#[deprecated = "SecTransform is no longer supported"]
#[inline]
pub unsafe extern "C-unwind" fn SecEncryptTransformCreate(
key_ref: &SecKey,
error: *mut *mut CFError,
) -> CFRetained<SecTransform> {
extern "C-unwind" {
fn SecEncryptTransformCreate(
key_ref: &SecKey,
error: *mut *mut CFError,
) -> Option<NonNull<SecTransform>>;
}
let ret = unsafe { SecEncryptTransformCreate(key_ref, error) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
/// Creates an encryption SecTransform object.
///
/// Parameter `keyRef`: The key for the operation
///
/// 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 encrypts data.
///
/// # Safety
///
/// `error` must be a valid pointer or null.
#[cfg(all(feature = "SecBase", feature = "SecTransform"))]
#[deprecated = "SecTransform is no longer supported"]
#[inline]
pub unsafe extern "C-unwind" fn SecDecryptTransformCreate(
key_ref: &SecKey,
error: *mut *mut CFError,
) -> CFRetained<SecTransform> {
extern "C-unwind" {
fn SecDecryptTransformCreate(
key_ref: &SecKey,
error: *mut *mut CFError,
) -> Option<NonNull<SecTransform>>;
}
let ret = unsafe { SecDecryptTransformCreate(key_ref, error) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
/// Returns the CFTypeID for a decrypt transform.
///
/// Returns: the CFTypeID
#[deprecated = "SecTransform is no longer supported"]
#[inline]
pub extern "C-unwind" fn SecDecryptTransformGetTypeID() -> CFTypeID {
extern "C-unwind" {
fn SecDecryptTransformGetTypeID() -> CFTypeID;
}
unsafe { SecDecryptTransformGetTypeID() }
}
/// Returns the CFTypeID for a decrypt transform.
///
/// Returns: the CFTypeID
#[deprecated = "SecTransform is no longer supported"]
#[inline]
pub extern "C-unwind" fn SecEncryptTransformGetTypeID() -> CFTypeID {
extern "C-unwind" {
fn SecEncryptTransformGetTypeID() -> CFTypeID;
}
unsafe { SecEncryptTransformGetTypeID() }
}