sentc_crypto/
lib.rs

1#![no_std]
2#![allow(
3	clippy::module_inception,
4	clippy::infallible_destructuring_match,
5	clippy::tabs_in_doc_comments,
6	clippy::manual_map,
7	clippy::explicit_counter_loop,
8	clippy::manual_range_contains,
9	clippy::type_complexity
10)]
11
12//! The base lib for all sentc libraries. Containing user- and group management as well as encryption, file-handling and search- and sortable encryption
13//!
14//! These are very low-level functionalities. It is recommended to use it with a sdks.
15//!
16//! This lib is defined as a "template" to use it with different crypto implementations thanks to rusts generic.
17//! As long as the implementation follows the traits defined in sentc-crypto-core and sentc-crypto-utils crate it can be used with this lib.
18//!
19//! # Overview
20//!
21//! Users and groups are structs with generic parameter.
22//! Pre-defined users and groups can be found in the keys mod
23//!
24//! Online actions like creating a new user or group can be found in the util_req_full mod
25//! and is only available when activating the feature full_rustls or full_wasm.
26//!
27//! For sdk implementations that uses ffi or wasm, the export feature can be used.
28//! All Keys are returned as exported string in base64 and all errors are string as well. This makes it easy to integrate with wasm.
29//! In every mod there are an _export file with the export implementation of the actual mod.
30//! For a full rust implementation this is not recommended.
31//!
32//! Every function with prepare and done or finish prefix can be used "offline" without server interactions
33//! but required the server responses. This is useful when certain processes needs to be handled differently.
34//!
35//! # Get started
36//!
37//! ```toml
38//! sentc-crypto = "<the actual version number>"
39//! ```
40//!
41//! To install it with pre-defined crypto implementation:
42//!
43//! * For the std keys:
44//! ```toml
45//! sentc-crypto = { version = "<the actual version number>", features = ["std_keys"] }
46//! ```
47//!
48//! * For fips complaint keys:
49//! ```toml
50//! sentc-crypto = { version = "<the actual version number>", features = ["fips_keys"] }
51//! ```
52//!
53//! * For the recommended keys:
54//! ```toml
55//! sentc-crypto = { version = "<the actual version number>", features = ["rec_keys"] }
56//! ```
57//!
58//! To get the online actions add the feature:
59//! * full_rustls to use rustls
60//! * full_wasm to use the web assembly requests
61
62extern crate alloc;
63
64pub mod crypto;
65pub mod crypto_searchable;
66pub mod crypto_sortable;
67pub mod entities;
68mod error;
69pub mod file;
70pub mod group;
71pub mod user;
72pub mod util;
73
74pub mod keys;
75#[cfg(any(feature = "full_rustls", feature = "full_wasm"))]
76pub mod util_req_full;
77
78/**
79For server testing export every common
80because using common from path via submodule resolve in version conflicts when using it in tests
81 */
82#[cfg(feature = "server_test")]
83pub use sentc_crypto_common as sdk_common;
84/**
85Reexport of the crypto core crate to access the raw types
86*/
87pub use sentc_crypto_core as sdk_core;
88#[cfg(feature = "fips_keys")]
89pub use sentc_crypto_fips_keys as fips_keys;
90#[cfg(feature = "rec_keys")]
91pub use sentc_crypto_rec_keys as rec_keys;
92#[cfg(feature = "std_keys")]
93pub use sentc_crypto_std_keys as std_keys;
94pub use sentc_crypto_utils as sdk_utils;
95
96pub use self::error::{err_to_msg, SdkError};