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