Skip to main content

ohos_crypto_sys/
lib.rs

1//! Bindings to the OpenHarmony CryptoArchitectureKit (`libohcrypto.so`).
2//!
3//! ## Overview
4//!
5//! CryptoArchitectureKit is the OpenHarmony cryptographic framework. It
6//! provides APIs for message digests, MAC, symmetric and asymmetric key
7//! generation, symmetric and asymmetric ciphers, signatures, key agreement,
8//! KDFs and random number generation.
9//!
10//! Available since OpenHarmony API-level 12. The asymmetric cipher, KDF, key
11//! agreement, MAC and random number generator modules were added in API-level
12//! 20.
13//!
14//! See also the [official CryptoArchitectureKit documentation](https://gitcode.com/openharmony/docs/blob/master/en/application-dev/reference/apis-crypto-architecture-kit/_crypto_common_api.md).
15//!
16//! ## Feature flags
17#![cfg_attr(
18    feature = "document-features",
19    cfg_attr(doc, doc = ::document_features::document_features!())
20)]
21#![cfg_attr(docsrs, feature(doc_cfg))]
22
23#[cfg(feature = "api-12")]
24#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
25pub mod common;
26
27#[cfg(feature = "api-12")]
28#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
29pub mod asym_key;
30
31#[cfg(feature = "api-12")]
32#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
33pub mod digest;
34
35#[cfg(feature = "api-12")]
36#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
37pub mod signature;
38
39#[cfg(feature = "api-12")]
40#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
41pub mod sym_cipher;
42
43#[cfg(feature = "api-12")]
44#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
45pub mod sym_key;
46
47#[cfg(feature = "api-20")]
48#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
49pub mod asym_cipher;
50
51#[cfg(feature = "api-20")]
52#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
53pub mod kdf;
54
55#[cfg(feature = "api-20")]
56#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
57pub mod key_agreement;
58
59#[cfg(feature = "api-20")]
60#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
61pub mod mac;
62
63#[cfg(feature = "api-20")]
64#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
65pub mod rand;
66
67#[cfg(feature = "api-12")]
68#[link(name = "ohcrypto")]
69unsafe extern "C" {}