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