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
117
118
119
120
//! 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" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/kseckeyattributename?language=objc)
pub static kSecKeyAttributeName: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecsignatureattributename?language=objc)
pub static kSecSignatureAttributeName: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecinputisattributename?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecInputIsAttributeName: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecinputisplaintext?language=objc)
pub static kSecInputIsPlainText: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecinputisdigest?language=objc)
pub static kSecInputIsDigest: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecinputisraw?language=objc)
#[deprecated = "SecTransform is no longer supported"]
pub static kSecInputIsRaw: &'static CFString;
}
/// Creates a sign computation object.
///
/// Parameter `key`: A SecKey with the private key used for signing.
///
/// 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 a
/// cryptographic signature. The InputIS defaults to kSecInputIsPlainText,
/// and the DigestType and DigestLength default to something appropriate for
/// the type of key you have supplied.
///
/// # Safety
///
/// `error` must be a valid pointer or null.
#[cfg(all(feature = "SecBase", feature = "SecTransform"))]
#[deprecated = "SecTransform is no longer supported"]
#[inline]
pub unsafe extern "C-unwind" fn SecSignTransformCreate(
key: &SecKey,
error: *mut *mut CFError,
) -> Option<CFRetained<SecTransform>> {
extern "C-unwind" {
fn SecSignTransformCreate(
key: &SecKey,
error: *mut *mut CFError,
) -> Option<NonNull<SecTransform>>;
}
let ret = unsafe { SecSignTransformCreate(key, error) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
/// Creates a verify computation object.
///
/// Parameter `key`: A SecKey with the public key used for signing.
///
/// Parameter `signature`: A CFDataRef with the signature. This value may be
/// NULL, and you may connect a transform to kSecTransformSignatureAttributeName
/// to supply it from another signature.
///
/// 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 verifies a
/// cryptographic signature. The InputIS defaults to kSecInputIsPlainText,
/// and the DigestType and DigestLength default to something appropriate for
/// the type of key you have supplied.
///
/// # Safety
///
/// `error` must be a valid pointer or null.
#[cfg(all(feature = "SecBase", feature = "SecTransform"))]
#[deprecated = "SecTransform is no longer supported"]
#[inline]
pub unsafe extern "C-unwind" fn SecVerifyTransformCreate(
key: &SecKey,
signature: Option<&CFData>,
error: *mut *mut CFError,
) -> Option<CFRetained<SecTransform>> {
extern "C-unwind" {
fn SecVerifyTransformCreate(
key: &SecKey,
signature: Option<&CFData>,
error: *mut *mut CFError,
) -> Option<NonNull<SecTransform>>;
}
let ret = unsafe { SecVerifyTransformCreate(key, signature, error) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}