objc2_security/generated/SecDecodeTransform.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 /// Used with SecTransformGetAttribute to query the attribute type.
10 /// Returns one of the strings defined in the previous section.
11 ///
12 /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecdecodetypeattribute?language=objc)
13 pub static kSecDecodeTypeAttribute: &'static CFString;
14}
15
16/// Creates an decode computation object.
17///
18/// Parameter `DecodeType`: The type of digest to decode. You may pass NULL
19/// for this parameter, in which case an appropriate
20/// algorithm will be chosen for you.
21///
22/// Parameter `error`: A pointer to a CFErrorRef. This pointer will be set
23/// if an error occurred. This value may be NULL if you
24/// do not want an error returned.
25///
26/// Returns: A pointer to a SecTransformRef object. This object must
27/// be released with CFRelease when you are done with
28/// it. This function will return NULL if an error
29/// occurred.
30///
31/// This function creates a transform which computes a
32/// decode.
33#[cfg(feature = "SecTransform")]
34#[deprecated = "SecTransform is no longer supported"]
35#[inline]
36pub unsafe extern "C-unwind" fn SecDecodeTransformCreate(
37 decode_type: &CFType,
38 error: *mut *mut CFError,
39) -> Option<CFRetained<SecTransform>> {
40 extern "C-unwind" {
41 fn SecDecodeTransformCreate(
42 decode_type: &CFType,
43 error: *mut *mut CFError,
44 ) -> Option<NonNull<SecTransform>>;
45 }
46 let ret = unsafe { SecDecodeTransformCreate(decode_type, error) };
47 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
48}