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