secure_gate/cloneable/mod.rs
1//! Cloneable secret primitives for handling sensitive data that can be safely duplicated.
2//!
3//! This module provides types that wrap sensitive data (arrays, vectors, and strings)
4//! in a way that allows controlled cloning while ensuring the data is properly zeroized
5//! when dropped. These types are only available when the "zeroize" feature is enabled.
6//!
7//! The types in this module implement the [`CloneSafe`] trait (from the `traits` module), which ensures
8//! that only types safe for secret duplication are used. This prevents accidental leaks
9//! of sensitive data through unsafe cloning operations.
10#[cfg(feature = "zeroize")]
11pub mod array;
12
13#[cfg(feature = "zeroize")]
14pub mod string;
15#[cfg(feature = "zeroize")]
16pub mod vec;
17
18#[cfg(feature = "zeroize")]
19pub use array::CloneableArray;
20
21#[cfg(feature = "zeroize")]
22pub use string::CloneableString;
23#[cfg(feature = "zeroize")]
24pub use vec::CloneableVec;