ohos-net-ssl-sys 0.1.0

Raw bindings to the OpenHarmony NetworkKit (net_ssl) native APIs
Documentation
// automatically generated by rust-bindgen 0.71.1

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
use crate::net_ssl_c_type::*;

extern "C" {
    /// Provides certificate chain verification APIs for external systems.
    ///
    /// # Arguments
    ///
    /// * `cert` - Certificate to be verified.
    ///
    /// * `caCert` - CA certificate specified by the user. If this parameter is left blank, the preset certificate is used.
    ///
    /// # Returns
    ///
    /// * 0 - success.
    /// 2305001 - Unspecified error.
    /// 2305002 - Unable to get issuer certificate.
    /// 2305003 - Unable to get certificate revocation list (CRL).
    /// 2305004 - Unable to decrypt certificate signature.
    /// 2305005 - Unable to decrypt CRL signature.
    /// 2305006 - Unable to decode issuer public key.
    /// 2305007 - Certificate signature failure.
    /// 2305008 - CRL signature failure.
    /// 2305009 - Certificate is not yet valid.
    /// 2305010 - Certificate has expired.
    /// 2305011 - CRL is not yet valid.
    /// 2305012 - CRL has expired.
    /// 2305023 - Certificate has been revoked.
    /// 2305024 - Invalid certificate authority (CA).
    /// 2305027 - Certificate is untrusted.
    ///
    /// Required System Capabilities: SystemCapability.Communication.NetStack
    ///
    /// Available since API-level: 11
    ///
    /// Version: 1.0
    #[cfg(feature = "api-11")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
    pub fn OH_NetStack_CertVerification(
        cert: *const NetStack_CertBlob,
        caCert: *const NetStack_CertBlob,
    ) -> u32;
    /// Gets pin set for hostname.
    ///
    /// # Arguments
    ///
    /// * `hostname` - Hostname.
    ///
    /// * `pin` - Certificate lock information.
    ///
    /// # Returns
    ///
    /// * 0 - Success.
    /// 401 - Parameter error.
    /// 2305999 - Out of memory.
    ///
    /// Required System Capabilities: SystemCapability.Communication.NetStack
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NetStack_GetPinSetForHostName(
        hostname: *const ::core::ffi::c_char,
        pin: *mut NetStack_CertificatePinning,
    ) -> i32;
    /// Gets certificates for hostname.
    ///
    /// # Arguments
    ///
    /// * `hostname` - Hostname.
    ///
    /// * `certs` - Certificate Information.
    ///
    /// # Returns
    ///
    /// * 0 - Success.
    /// 401 - Parameter error.
    /// 2305999 - Out of memory.
    ///
    /// Required System Capabilities: SystemCapability.Communication.NetStack
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NetStack_GetCertificatesForHostName(
        hostname: *const ::core::ffi::c_char,
        certs: *mut NetStack_Certificates,
    ) -> i32;
    /// Frees content of the certificates.
    ///
    /// # Arguments
    ///
    /// * `certs` - Certificate.
    ///
    /// Required System Capabilities: SystemCapability.Communication.NetStack
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Netstack_DestroyCertificatesContent(certs: *mut NetStack_Certificates);
    /// Checks whether the Cleartext traffic is permitted.
    ///
    /// ohos.permission.INTERNET
    ///
    /// # Returns
    ///
    /// * 0 - Success.
    /// 201 - Permission denied.
    /// 401 - Parameter error.
    /// # Arguments
    ///
    /// * `isCleartextPermitted` - Indicates output parameter,
    /// `true` if the Cleartext traffic is permitted, `false` otherwise.
    ///
    /// Available since API-level: 18
    #[cfg(feature = "api-18")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
    pub fn OH_Netstack_IsCleartextPermitted(isCleartextPermitted: *mut bool) -> i32;
    /// Checks whether the Cleartext traffic for a specified hostname is permitted.
    ///
    /// ohos.permission.INTERNET
    ///
    /// # Returns
    ///
    /// * 0 - Success.
    /// 201 - Permission denied.
    /// 401 - Parameter error.
    /// # Arguments
    ///
    /// * `hostname` - Indicates the host name.
    ///
    /// * `isCleartextPermitted` - Indicates output parameter,
    /// `true` if the Cleartext traffic for a specified hostname is permitted, `false` otherwise.
    ///
    /// Available since API-level: 18
    #[cfg(feature = "api-18")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
    pub fn OH_Netstack_IsCleartextPermittedByHostName(
        hostname: *const ::core::ffi::c_char,
        isCleartextPermitted: *mut bool,
    ) -> i32;
    /// Checks whether the component is configured for Cleartext traffic interception.
    ///
    ///
    /// # Returns
    ///
    /// * 0 - Success.
    /// 2100001 - Invalid parameter value.
    /// # Arguments
    ///
    /// * `component` - Indicates the component name.
    ///
    /// * `componentCfg` - Indicates output parameter,
    /// `true` if the component is configured for Cleartext traffic interception, `false` otherwise.
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_Netstack_IsCleartextCfgByComponent(
        component: *const ::core::ffi::c_char,
        componentCfg: *mut bool,
    ) -> i32;
}