objc2-security 0.3.2

Bindings to the Security framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_data?language=objc)
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct cssm_data {
    pub Length: usize,
    pub Data: *mut u8,
}

#[cfg(feature = "objc2")]
unsafe impl Encode for cssm_data {
    const ENCODING: Encoding =
        Encoding::Struct("cssm_data", &[<usize>::ENCODING, <*mut u8>::ENCODING]);
}

#[cfg(feature = "objc2")]
unsafe impl RefEncode for cssm_data {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/security/secasn1item?language=objc)
#[deprecated = "SecAsn1 is not supported"]
pub type SecAsn1Item = cssm_data;

/// [Apple's documentation](https://developer.apple.com/documentation/security/secasn1oid?language=objc)
#[deprecated = "SecAsn1 is not supported"]
pub type SecAsn1Oid = cssm_data;

/// [Apple's documentation](https://developer.apple.com/documentation/security/secasn1algid?language=objc)
#[deprecated = "SecAsn1 is not supported"]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct SecAsn1AlgId {
    pub algorithm: SecAsn1Oid,
    pub parameters: SecAsn1Item,
}

#[cfg(feature = "objc2")]
unsafe impl Encode for SecAsn1AlgId {
    const ENCODING: Encoding =
        Encoding::Struct("?", &[<SecAsn1Oid>::ENCODING, <SecAsn1Item>::ENCODING]);
}

#[cfg(feature = "objc2")]
unsafe impl RefEncode for SecAsn1AlgId {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/security/secasn1pubkeyinfo?language=objc)
#[deprecated = "SecAsn1 is not supported"]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct SecAsn1PubKeyInfo {
    pub algorithm: SecAsn1AlgId,
    pub subjectPublicKey: SecAsn1Item,
}

#[cfg(feature = "objc2")]
unsafe impl Encode for SecAsn1PubKeyInfo {
    const ENCODING: Encoding =
        Encoding::Struct("?", &[<SecAsn1AlgId>::ENCODING, <SecAsn1Item>::ENCODING]);
}

#[cfg(feature = "objc2")]
unsafe impl RefEncode for SecAsn1PubKeyInfo {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/security/secasn1template_struct?language=objc)
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct SecAsn1Template_struct {
    pub kind: u32,
    pub offset: u32,
    pub sub: NonNull<c_void>,
    pub size: u32,
}

#[cfg(feature = "objc2")]
unsafe impl Encode for SecAsn1Template_struct {
    const ENCODING: Encoding = Encoding::Struct(
        "SecAsn1Template_struct",
        &[
            <u32>::ENCODING,
            <u32>::ENCODING,
            <NonNull<c_void>>::ENCODING,
            <u32>::ENCODING,
        ],
    );
}

#[cfg(feature = "objc2")]
unsafe impl RefEncode for SecAsn1Template_struct {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/security/secasn1template?language=objc)
#[deprecated = "SecAsn1 is not supported"]
pub type SecAsn1Template = SecAsn1Template_struct;

/// [Apple's documentation](https://developer.apple.com/documentation/security/secasn1templatechooser?language=objc)
#[deprecated = "SecAsn1 is not supported"]
pub type SecAsn1TemplateChooser = core::ffi::c_void;

/// [Apple's documentation](https://developer.apple.com/documentation/security/secasn1templatechooserptr?language=objc)
#[deprecated = "SecAsn1 is not supported"]
pub type SecAsn1TemplateChooserPtr = *mut SecAsn1TemplateChooser;