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, 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#[cfg(feature = "zeroize")]
13pub mod marker;
14#[cfg(feature = "zeroize")]
15pub mod string;
16#[cfg(feature = "zeroize")]
17pub mod vec;
18
19#[cfg(feature = "zeroize")]
20pub use array::CloneableArray;
21#[cfg(feature = "zeroize")]
22pub use marker::CloneSafe;
23#[cfg(feature = "zeroize")]
24pub use string::CloneableString;
25#[cfg(feature = "zeroize")]
26pub use vec::CloneableVec;