objc2_security/generated/SecEncryptTransform.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
8extern "C" {
9 /// Indicates that no padding will be used when encrypting or decrypting.
10 ///
11 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecpaddingnonekey?language=objc)
12 #[deprecated = "SecTransform is no longer supported"]
13 pub static kSecPaddingNoneKey: &'static CFString;
14}
15
16extern "C" {
17 /// Indicates that PKCS1 padding will be used when encrypting or decrypting.
18 ///
19 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecpaddingpkcs1key?language=objc)
20 #[deprecated = "SecTransform is no longer supported"]
21 pub static kSecPaddingPKCS1Key: &'static CFString;
22}
23
24extern "C" {
25 /// Indicates that PKCS5 padding will be used when encrypting or decrypting.
26 ///
27 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecpaddingpkcs5key?language=objc)
28 #[deprecated = "SecTransform is no longer supported"]
29 pub static kSecPaddingPKCS5Key: &'static CFString;
30}
31
32extern "C" {
33 /// Indicates that PKCS7 padding will be used when encrypting or decrypting.
34 ///
35 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecpaddingpkcs7key?language=objc)
36 #[deprecated = "SecTransform is no longer supported"]
37 pub static kSecPaddingPKCS7Key: &'static CFString;
38}
39
40extern "C" {
41 /// Indicates that PKCS7 padding will be used when encrypting or decrypting.
42 ///
43 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecpaddingoaepkey?language=objc)
44 #[deprecated = "SecTransform is no longer supported"]
45 pub static kSecPaddingOAEPKey: &'static CFString;
46}
47
48extern "C" {
49 /// Indicates that no mode will be used when encrypting or decrypting.
50 ///
51 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecmodenonekey?language=objc)
52 #[deprecated = "SecTransform is no longer supported"]
53 pub static kSecModeNoneKey: &'static CFString;
54}
55
56extern "C" {
57 /// Indicates that ECB mode will be used when encrypting or decrypting.
58 ///
59 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecmodeecbkey?language=objc)
60 #[deprecated = "SecTransform is no longer supported"]
61 pub static kSecModeECBKey: &'static CFString;
62}
63
64extern "C" {
65 /// Indicates that CBC mode will be used when encrypting or decrypting.
66 ///
67 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecmodecbckey?language=objc)
68 #[deprecated = "SecTransform is no longer supported"]
69 pub static kSecModeCBCKey: &'static CFString;
70}
71
72extern "C" {
73 /// Indicates that CFB mode will be used when encrypting or decrypting.
74 ///
75 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecmodecfbkey?language=objc)
76 #[deprecated = "SecTransform is no longer supported"]
77 pub static kSecModeCFBKey: &'static CFString;
78}
79
80extern "C" {
81 /// Indicates that OFB mode will be used when encrypting or decrypting.
82 ///
83 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecmodeofbkey?language=objc)
84 #[deprecated = "SecTransform is no longer supported"]
85 pub static kSecModeOFBKey: &'static CFString;
86}
87
88extern "C" {
89 /// This attribute holds the encryption key for the transform. (ReadOnly)
90 ///
91 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecencryptkey?language=objc)
92 #[deprecated = "SecTransform is no longer supported"]
93 pub static kSecEncryptKey: &'static CFString;
94}
95
96extern "C" {
97 /// Key for setting padding.
98 ///
99 /// This key is optional. If you do not supply a value for this key,
100 /// an appropriate value will be supplied for you.
101 ///
102 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecpaddingkey?language=objc)
103 #[deprecated = "SecTransform is no longer supported"]
104 pub static kSecPaddingKey: &'static CFString;
105}
106
107extern "C" {
108 /// Key for setting an initialization vector.
109 ///
110 /// This key is optional. If you do not supply a
111 /// value for this key, an appropriate value will be supplied for you.
112 ///
113 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecivkey?language=objc)
114 #[deprecated = "SecTransform is no longer supported"]
115 pub static kSecIVKey: &'static CFString;
116}
117
118extern "C" {
119 /// Specifies the encryption mode.
120 ///
121 /// This key is optional. If you do not supply this key,
122 /// an appropriate value will be supplied for you.
123 ///
124 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecencryptionmode?language=objc)
125 #[deprecated = "SecTransform is no longer supported"]
126 pub static kSecEncryptionMode: &'static CFString;
127}
128
129extern "C" {
130 /// Specifies the OAEP message length.
131 ///
132 /// This should be set to a CFNumberRef when the padding is set to OAEP,
133 /// and a specific messages size is desired. If unset the minimum padding
134 /// will be added. It is ignored when the padding mode is not OAEP.
135 ///
136 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecoaepmessagelengthattributename?language=objc)
137 #[deprecated = "SecTransform is no longer supported"]
138 pub static kSecOAEPMessageLengthAttributeName: &'static CFString;
139}
140
141extern "C" {
142 /// Specifies the OAEP encoding paramaters
143 ///
144 /// This should be set to a CFDataRef when the padding is set to OAEP.
145 /// If unset a zero length CFDataRef is used. It is ignored by non
146 /// OAEP padding modes.
147 ///
148 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecoaepencodingparametersattributename?language=objc)
149 #[deprecated = "SecTransform is no longer supported"]
150 pub static kSecOAEPEncodingParametersAttributeName: &'static CFString;
151}
152
153extern "C" {
154 /// Specifies the OAEP MGF1 digest algorithm.
155 ///
156 /// This should be set to a digest algorithm when the padding is set to OAEP.
157 /// If unset SHA1 is used. It is ifnored by non OAEP padding modes.
158 ///
159 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecoaepmgf1digestalgorithmattributename?language=objc)
160 #[deprecated = "SecTransform is no longer supported"]
161 pub static kSecOAEPMGF1DigestAlgorithmAttributeName: &'static CFString;
162}
163
164/// Creates an encryption SecTransform object.
165///
166/// Parameter `keyRef`: The key for the encryption operation
167///
168/// Parameter `error`: A pointer to a CFErrorRef. This pointer will be set
169/// if an error occurred. This value may be NULL if you
170/// do not want an error returned.
171///
172/// Returns: A pointer to a SecTransformRef object. This object must
173/// be released with CFRelease when you are done with
174/// it. This function will return NULL if an error
175/// occurred.
176///
177/// This function creates a transform which encrypts data.
178///
179/// # Safety
180///
181/// `error` must be a valid pointer or null.
182#[cfg(all(feature = "SecBase", feature = "SecTransform"))]
183#[deprecated = "SecTransform is no longer supported"]
184#[inline]
185pub unsafe extern "C-unwind" fn SecEncryptTransformCreate(
186 key_ref: &SecKey,
187 error: *mut *mut CFError,
188) -> CFRetained<SecTransform> {
189 extern "C-unwind" {
190 fn SecEncryptTransformCreate(
191 key_ref: &SecKey,
192 error: *mut *mut CFError,
193 ) -> Option<NonNull<SecTransform>>;
194 }
195 let ret = unsafe { SecEncryptTransformCreate(key_ref, error) };
196 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
197 unsafe { CFRetained::from_raw(ret) }
198}
199
200/// Creates an encryption SecTransform object.
201///
202/// Parameter `keyRef`: The key for the operation
203///
204/// Parameter `error`: A pointer to a CFErrorRef. This pointer will be set
205/// if an error occurred. This value may be NULL if you
206/// do not want an error returned.
207///
208/// Returns: A pointer to a SecTransformRef object. This object must
209/// be released with CFRelease when you are done with
210/// it. This function will return NULL if an error
211/// occurred.
212///
213/// This function creates a transform which encrypts data.
214///
215/// # Safety
216///
217/// `error` must be a valid pointer or null.
218#[cfg(all(feature = "SecBase", feature = "SecTransform"))]
219#[deprecated = "SecTransform is no longer supported"]
220#[inline]
221pub unsafe extern "C-unwind" fn SecDecryptTransformCreate(
222 key_ref: &SecKey,
223 error: *mut *mut CFError,
224) -> CFRetained<SecTransform> {
225 extern "C-unwind" {
226 fn SecDecryptTransformCreate(
227 key_ref: &SecKey,
228 error: *mut *mut CFError,
229 ) -> Option<NonNull<SecTransform>>;
230 }
231 let ret = unsafe { SecDecryptTransformCreate(key_ref, error) };
232 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
233 unsafe { CFRetained::from_raw(ret) }
234}
235
236/// Returns the CFTypeID for a decrypt transform.
237///
238/// Returns: the CFTypeID
239#[deprecated = "SecTransform is no longer supported"]
240#[inline]
241pub extern "C-unwind" fn SecDecryptTransformGetTypeID() -> CFTypeID {
242 extern "C-unwind" {
243 fn SecDecryptTransformGetTypeID() -> CFTypeID;
244 }
245 unsafe { SecDecryptTransformGetTypeID() }
246}
247
248/// Returns the CFTypeID for a decrypt transform.
249///
250/// Returns: the CFTypeID
251#[deprecated = "SecTransform is no longer supported"]
252#[inline]
253pub extern "C-unwind" fn SecEncryptTransformGetTypeID() -> CFTypeID {
254 extern "C-unwind" {
255 fn SecEncryptTransformGetTypeID() -> CFTypeID;
256 }
257 unsafe { SecEncryptTransformGetTypeID() }
258}