objc2_security/generated/
SecEncodeTransform.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    /// Specifies a base 64 encoding
10    ///
11    /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecbase64encoding?language=objc)
12    #[deprecated = "SecTransform is no longer supported"]
13    pub static kSecBase64Encoding: &'static CFString;
14}
15
16extern "C" {
17    /// Specifies a base 32 encoding
18    ///
19    /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecbase32encoding?language=objc)
20    #[deprecated = "SecTransform is no longer supported"]
21    pub static kSecBase32Encoding: &'static CFString;
22}
23
24extern "C" {
25    /// Specifies a compressed encoding.
26    ///
27    /// See also [Apple's documentation](https://developer.apple.com/documentation/security/kseczlibencoding?language=objc)
28    #[deprecated = "SecTransform is no longer supported"]
29    pub static kSecZLibEncoding: &'static CFString;
30}
31
32extern "C" {
33    /// Used with SecTransformGetAttribute to query the attribute type.
34    /// Returns one of the strings defined in the previous section.
35    ///
36    /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecencodetypeattribute?language=objc)
37    #[deprecated = "SecTransform is no longer supported"]
38    pub static kSecEncodeTypeAttribute: &'static CFString;
39}
40
41extern "C" {
42    /// [Apple's documentation](https://developer.apple.com/documentation/security/kseclinelength64?language=objc)
43    #[deprecated = "SecTransform is no longer supported"]
44    pub static kSecLineLength64: &'static CFString;
45}
46
47extern "C" {
48    /// [Apple's documentation](https://developer.apple.com/documentation/security/kseclinelength76?language=objc)
49    #[deprecated = "SecTransform is no longer supported"]
50    pub static kSecLineLength76: &'static CFString;
51}
52
53extern "C" {
54    /// Used with SecTransformSetAttribute to set the length
55    /// of encoded Base32 or Base64 lines.   Some systems will
56    /// not decode or otherwise deal with excessively long lines,
57    /// or may be defined to limit lines to specific lengths
58    /// (for example RFC1421 - 64, and RFC2045 - 76).
59    ///
60    /// The LineLengthAttribute may be set to any positive
61    /// value (via a CFNumberRef) to limit to a specific
62    /// length (values smaller then X for Base32 or Y for Base64
63    /// are assume to be X or Y), or to zero for no specific
64    /// limit.   Either of the string constants kSecLineLength64
65    /// (RFC1421), or kSecLineLength76 (RFC2045) may be used to
66    /// set line lengths of 64 or 76 bytes.
67    ///
68    /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecencodelinelengthattribute?language=objc)
69    #[deprecated = "SecTransform is no longer supported"]
70    pub static kSecEncodeLineLengthAttribute: &'static CFString;
71}
72
73extern "C" {
74    /// [Apple's documentation](https://developer.apple.com/documentation/security/kseccompressionratio?language=objc)
75    #[deprecated = "SecTransform is no longer supported"]
76    pub static kSecCompressionRatio: &'static CFString;
77}
78
79/// Creates an encode computation object.
80///
81/// Parameter `encodeType`: The type of encoding to compute.  You may pass NULL
82/// for this parameter, in which case an appropriate
83/// algorithm will be chosen for you.
84///
85/// Parameter `error`: A pointer to a CFErrorRef.  This pointer will be set
86/// if an error occurred.  This value may be NULL if you
87/// do not want an error returned.
88///
89/// Returns: A pointer to a SecTransformRef object.  This object must
90/// be released with CFRelease when you are done with
91/// it.  This function will return NULL if an error
92/// occurred.
93///
94/// This function creates a transform which computes an
95/// encode.
96///
97/// # Safety
98///
99/// - `encode_type` should be of the correct type.
100/// - `error` must be a valid pointer or null.
101#[cfg(feature = "SecTransform")]
102#[deprecated = "SecTransform is no longer supported"]
103#[inline]
104pub unsafe extern "C-unwind" fn SecEncodeTransformCreate(
105    encode_type: &CFType,
106    error: *mut *mut CFError,
107) -> Option<CFRetained<SecTransform>> {
108    extern "C-unwind" {
109        fn SecEncodeTransformCreate(
110            encode_type: &CFType,
111            error: *mut *mut CFError,
112        ) -> Option<NonNull<SecTransform>>;
113    }
114    let ret = unsafe { SecEncodeTransformCreate(encode_type, error) };
115    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
116}