objc2_security/generated/SecSignVerifyTransform.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 /// [Apple's documentation](https://developer.apple.com/documentation/security/kseckeyattributename?language=objc)
10 pub static kSecKeyAttributeName: &'static CFString;
11}
12
13extern "C" {
14 /// [Apple's documentation](https://developer.apple.com/documentation/security/ksecsignatureattributename?language=objc)
15 pub static kSecSignatureAttributeName: &'static CFString;
16}
17
18extern "C" {
19 /// [Apple's documentation](https://developer.apple.com/documentation/security/ksecinputisattributename?language=objc)
20 #[deprecated = "SecTransform is no longer supported"]
21 pub static kSecInputIsAttributeName: &'static CFString;
22}
23
24extern "C" {
25 /// [Apple's documentation](https://developer.apple.com/documentation/security/ksecinputisplaintext?language=objc)
26 pub static kSecInputIsPlainText: &'static CFString;
27}
28
29extern "C" {
30 /// [Apple's documentation](https://developer.apple.com/documentation/security/ksecinputisdigest?language=objc)
31 pub static kSecInputIsDigest: &'static CFString;
32}
33
34extern "C" {
35 /// [Apple's documentation](https://developer.apple.com/documentation/security/ksecinputisraw?language=objc)
36 #[deprecated = "SecTransform is no longer supported"]
37 pub static kSecInputIsRaw: &'static CFString;
38}
39
40/// Creates a sign computation object.
41///
42/// Parameter `key`: A SecKey with the private key used for signing.
43///
44/// Parameter `error`: A pointer to a CFErrorRef. This pointer will be set
45/// if an error occurred. This value may be NULL if you
46/// do not want an error returned.
47///
48/// Returns: A pointer to a SecTransformRef object. This object must
49/// be released with CFRelease when you are done with
50/// it. This function will return NULL if an error
51/// occurred.
52///
53/// This function creates a transform which computes a
54/// cryptographic signature. The InputIS defaults to kSecInputIsPlainText,
55/// and the DigestType and DigestLength default to something appropriate for
56/// the type of key you have supplied.
57///
58/// # Safety
59///
60/// `error` must be a valid pointer or null.
61#[cfg(all(feature = "SecBase", feature = "SecTransform"))]
62#[deprecated = "SecTransform is no longer supported"]
63#[inline]
64pub unsafe extern "C-unwind" fn SecSignTransformCreate(
65 key: &SecKey,
66 error: *mut *mut CFError,
67) -> Option<CFRetained<SecTransform>> {
68 extern "C-unwind" {
69 fn SecSignTransformCreate(
70 key: &SecKey,
71 error: *mut *mut CFError,
72 ) -> Option<NonNull<SecTransform>>;
73 }
74 let ret = unsafe { SecSignTransformCreate(key, error) };
75 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
76}
77
78/// Creates a verify computation object.
79///
80/// Parameter `key`: A SecKey with the public key used for signing.
81///
82/// Parameter `signature`: A CFDataRef with the signature. This value may be
83/// NULL, and you may connect a transform to kSecTransformSignatureAttributeName
84/// to supply it from another signature.
85///
86/// Parameter `error`: A pointer to a CFErrorRef. This pointer will be set
87/// if an error occurred. This value may be NULL if you
88/// do not want an error returned.
89///
90/// Returns: A pointer to a SecTransformRef object. This object must
91/// be released with CFRelease when you are done with
92/// it. This function will return NULL if an error
93/// occurred.
94///
95/// This function creates a transform which verifies a
96/// cryptographic signature. The InputIS defaults to kSecInputIsPlainText,
97/// and the DigestType and DigestLength default to something appropriate for
98/// the type of key you have supplied.
99///
100/// # Safety
101///
102/// `error` must be a valid pointer or null.
103#[cfg(all(feature = "SecBase", feature = "SecTransform"))]
104#[deprecated = "SecTransform is no longer supported"]
105#[inline]
106pub unsafe extern "C-unwind" fn SecVerifyTransformCreate(
107 key: &SecKey,
108 signature: Option<&CFData>,
109 error: *mut *mut CFError,
110) -> Option<CFRetained<SecTransform>> {
111 extern "C-unwind" {
112 fn SecVerifyTransformCreate(
113 key: &SecKey,
114 signature: Option<&CFData>,
115 error: *mut *mut CFError,
116 ) -> Option<NonNull<SecTransform>>;
117 }
118 let ret = unsafe { SecVerifyTransformCreate(key, signature, error) };
119 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
120}