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::*;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_krsp_handle?language=objc)
#[cfg(feature = "cssmconfig")]
pub type CSSM_KRSP_HANDLE = uint32;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_name?language=objc)
#[cfg(feature = "cssmconfig")]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct cssm_kr_name {
    pub Type: uint8,
    pub Length: uint8,
    pub Name: *mut c_char,
}

#[cfg(all(feature = "cssmconfig", feature = "objc2"))]
unsafe impl Encode for cssm_kr_name {
    const ENCODING: Encoding = Encoding::Struct(
        "cssm_kr_name",
        &[
            <uint8>::ENCODING,
            <uint8>::ENCODING,
            <*mut c_char>::ENCODING,
        ],
    );
}

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

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_name?language=objc)
#[deprecated]
#[cfg(feature = "cssmconfig")]
pub type CSSM_KR_NAME = cssm_kr_name;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_profile?language=objc)
#[cfg(all(feature = "SecAsn1Types", feature = "cssmconfig", feature = "cssmtype"))]
#[deprecated]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct cssm_kr_profile {
    pub UserName: CSSM_KR_NAME,
    pub UserCertificate: CSSM_CERTGROUP_PTR,
    pub KRSCertChain: CSSM_CERTGROUP_PTR,
    pub LE_KRANum: uint8,
    pub LE_KRACertChainList: CSSM_CERTGROUP_PTR,
    pub ENT_KRANum: uint8,
    pub ENT_KRACertChainList: CSSM_CERTGROUP_PTR,
    pub INDIV_KRANum: uint8,
    pub INDIV_KRACertChainList: CSSM_CERTGROUP_PTR,
    pub INDIV_AuthenticationInfo: CSSM_DATA_PTR,
    pub KRSPFlags: uint32,
    pub KRSPExtensions: CSSM_DATA_PTR,
}

#[cfg(all(
    feature = "SecAsn1Types",
    feature = "cssmconfig",
    feature = "cssmtype",
    feature = "objc2"
))]
unsafe impl Encode for cssm_kr_profile {
    const ENCODING: Encoding = Encoding::Struct(
        "cssm_kr_profile",
        &[
            <CSSM_KR_NAME>::ENCODING,
            <CSSM_CERTGROUP_PTR>::ENCODING,
            <CSSM_CERTGROUP_PTR>::ENCODING,
            <uint8>::ENCODING,
            <CSSM_CERTGROUP_PTR>::ENCODING,
            <uint8>::ENCODING,
            <CSSM_CERTGROUP_PTR>::ENCODING,
            <uint8>::ENCODING,
            <CSSM_CERTGROUP_PTR>::ENCODING,
            <CSSM_DATA_PTR>::ENCODING,
            <uint32>::ENCODING,
            <CSSM_DATA_PTR>::ENCODING,
        ],
    );
}

#[cfg(all(
    feature = "SecAsn1Types",
    feature = "cssmconfig",
    feature = "cssmtype",
    feature = "objc2"
))]
unsafe impl RefEncode for cssm_kr_profile {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_profile?language=objc)
#[deprecated]
#[cfg(all(feature = "SecAsn1Types", feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_KR_PROFILE = cssm_kr_profile;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_profile_ptr?language=objc)
#[deprecated]
#[cfg(all(feature = "SecAsn1Types", feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_KR_PROFILE_PTR = *mut cssm_kr_profile;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_wrappedproductinfo?language=objc)
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
#[deprecated]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct cssm_kr_wrappedproductinfo {
    pub StandardVersion: CSSM_VERSION,
    pub StandardDescription: CSSM_STRING,
    pub ProductVersion: CSSM_VERSION,
    pub ProductDescription: CSSM_STRING,
    pub ProductVendor: CSSM_STRING,
    pub ProductFlags: uint32,
}

#[cfg(all(feature = "cssmconfig", feature = "cssmtype", feature = "objc2"))]
unsafe impl Encode for cssm_kr_wrappedproductinfo {
    const ENCODING: Encoding = Encoding::Struct(
        "cssm_kr_wrappedproductinfo",
        &[
            <CSSM_VERSION>::ENCODING,
            <CSSM_STRING>::ENCODING,
            <CSSM_VERSION>::ENCODING,
            <CSSM_STRING>::ENCODING,
            <CSSM_STRING>::ENCODING,
            <uint32>::ENCODING,
        ],
    );
}

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

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_wrappedproduct_info?language=objc)
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_KR_WRAPPEDPRODUCT_INFO = cssm_kr_wrappedproductinfo;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_wrappedproduct_info_ptr?language=objc)
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_KR_WRAPPEDPRODUCT_INFO_PTR = *mut cssm_kr_wrappedproductinfo;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_krsubservice?language=objc)
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
#[deprecated]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct cssm_krsubservice {
    pub SubServiceId: uint32,
    pub Description: *mut c_char,
    pub WrappedProduct: CSSM_KR_WRAPPEDPRODUCT_INFO,
}

#[cfg(all(feature = "cssmconfig", feature = "cssmtype", feature = "objc2"))]
unsafe impl Encode for cssm_krsubservice {
    const ENCODING: Encoding = Encoding::Struct(
        "cssm_krsubservice",
        &[
            <uint32>::ENCODING,
            <*mut c_char>::ENCODING,
            <CSSM_KR_WRAPPEDPRODUCT_INFO>::ENCODING,
        ],
    );
}

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

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_krsubservice?language=objc)
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_KRSUBSERVICE = cssm_krsubservice;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_krsubservice_ptr?language=objc)
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_KRSUBSERVICE_PTR = *mut cssm_krsubservice;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_policy_type?language=objc)
#[cfg(feature = "cssmconfig")]
pub type CSSM_KR_POLICY_TYPE = uint32;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_policy_flags?language=objc)
#[cfg(feature = "cssmconfig")]
pub type CSSM_KR_POLICY_FLAGS = uint32;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_policy_list_item?language=objc)
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
#[deprecated]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct cssm_kr_policy_list_item {
    pub next: *mut kr_policy_list_item,
    pub AlgorithmId: CSSM_ALGORITHMS,
    pub Mode: CSSM_ENCRYPT_MODE,
    pub MaxKeyLength: uint32,
    pub MaxRounds: uint32,
    pub WorkFactor: uint8,
    pub PolicyFlags: CSSM_KR_POLICY_FLAGS,
    pub AlgClass: CSSM_CONTEXT_TYPE,
}

#[cfg(all(feature = "cssmconfig", feature = "cssmtype", feature = "objc2"))]
unsafe impl Encode for cssm_kr_policy_list_item {
    const ENCODING: Encoding = Encoding::Struct(
        "cssm_kr_policy_list_item",
        &[
            <*mut kr_policy_list_item>::ENCODING,
            <CSSM_ALGORITHMS>::ENCODING,
            <CSSM_ENCRYPT_MODE>::ENCODING,
            <uint32>::ENCODING,
            <uint32>::ENCODING,
            <uint8>::ENCODING,
            <CSSM_KR_POLICY_FLAGS>::ENCODING,
            <CSSM_CONTEXT_TYPE>::ENCODING,
        ],
    );
}

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

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_policy_list_item?language=objc)
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_KR_POLICY_LIST_ITEM = cssm_kr_policy_list_item;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_policy_list_item_ptr?language=objc)
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_KR_POLICY_LIST_ITEM_PTR = *mut cssm_kr_policy_list_item;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_policy_info?language=objc)
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
#[deprecated]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct cssm_kr_policy_info {
    pub krbNotAllowed: CSSM_BOOL,
    pub numberOfEntries: uint32,
    pub policyEntry: *mut CSSM_KR_POLICY_LIST_ITEM,
}

#[cfg(all(feature = "cssmconfig", feature = "cssmtype", feature = "objc2"))]
unsafe impl Encode for cssm_kr_policy_info {
    const ENCODING: Encoding = Encoding::Struct(
        "cssm_kr_policy_info",
        &[
            <CSSM_BOOL>::ENCODING,
            <uint32>::ENCODING,
            <*mut CSSM_KR_POLICY_LIST_ITEM>::ENCODING,
        ],
    );
}

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

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_policy_info?language=objc)
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_KR_POLICY_INFO = cssm_kr_policy_info;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_kr_policy_info_ptr?language=objc)
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_KR_POLICY_INFO_PTR = *mut cssm_kr_policy_info;