rust-libteec 0.4.6

Rust implementation of TEE Client API for secure communication with Trusted Applications.
Documentation
// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2025-2026 KylinSoft Co., Ltd. <https://www.kylinos.cn/>
// See LICENSES for license details.

//! # rust-libteec
//!
//! GlobalPlatform TEE Client API 的 Rust 实现,提供与可信执行环境(TEE)通信的接口。
//!
//! ## 主要功能
//!
//! - **TEE 上下文管理**: 初始化和销毁 TEE 连接
//! - **会话管理**: 打开/关闭与 Trusted Application 的会话
//! - **命令调用**: 在 TA 中执行命令并传递参数(通过机密通信通道序列化传输)
//! - **共享内存**: 管理 MEMREF 类型参数的本地缓冲区(数据通过机密通信通道传输,非真正共享)
//! - **机密通信**: 基于 TLS + VSOCK 的加密通信通道,CA 与 TA 之间的所有数据都通过此通道传输
//! - **CA 认证**: 自动验证客户端应用的签名和证书链,为 TA 提供 ACL 访问控制信息
//!
//! ## 特性标志
//!
//! - `ca-sign-verify`: 启用 CA 认证功能(默认启用)
//! - `debug_level_0` ~ `debug_level_4`: 控制日志详细程度(默认 level_2)

mod cc_client;
mod error;
mod teec;
mod teec_trace;

pub use self::{
    error::{Error, ErrorKind, ErrorOrigin, Result},
    teec::{
        TEEC_AllocateSharedMemory, TEEC_CloseSession, TEEC_FinalizeContext, TEEC_InitializeContext,
        TEEC_InvokeCommand, TEEC_OpenSession, TEEC_RegisterSharedMemory, TEEC_ReleaseSharedMemory,
        TEEC_RequestCancellation,
    },
    teec_trace::*,
};

#[cfg(feature = "ca-sign-verify")]
pub use self::teec::{clear_cache, get_or_verify_ca};

pub use teec_api_types as raw;
pub use teec_protocol::CaAuthInfo;