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///
34/// # Safety
35///
36/// - `decode_type` should be of the correct type.
37/// - `error` must be a valid pointer or null.
38#[cfg(feature = "SecTransform")]
39#[deprecated = "SecTransform is no longer supported"]
40#[inline]
41pub unsafe extern "C-unwind" fn SecDecodeTransformCreate(
42    decode_type: &CFType,
43    error: *mut *mut CFError,
44) -> Option<CFRetained<SecTransform>> {
45    extern "C-unwind" {
46        fn SecDecodeTransformCreate(
47            decode_type: &CFType,
48            error: *mut *mut CFError,
49        ) -> Option<NonNull<SecTransform>>;
50    }
51    let ret = unsafe { SecDecodeTransformCreate(decode_type, error) };
52    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
53}