Expand description
Zero-cost secure wrappers for secrets — Fixed<T> for stack, Dynamic<T> for heap.
This crate provides explicit wrappers for sensitive data like CloneableArray, CloneableString, and CloneSafe, ensuring no accidental exposure.
See README.md for usage and examples.
Re-exports§
pub use cloneable::CloneableArray;pub use cloneable::CloneableString;pub use cloneable::CloneableVec;pub use random::DynamicRandom;pub use random::FixedRandom;pub use encoding::hex::HexString;pub use encoding::base64::Base64String;pub use encoding::bech32::Bech32String;
Modules§
- cloneable
- Cloneable secret types (requires the
zeroizefeature). Provides wrappers that can be safely duplicated while maintaining security guarantees. Cloneable secret primitives for handling sensitive data that can be safely duplicated. - encoding
- Encoding utilities for secrets (various encoding features available). Secure encoding/decoding with validation and zeroization. Encoding utilities for secure handling of encoded secret data.
- random
- Available macros (exported globally for convenience):
Macros§
- dynamic_
alias - Creates a type alias for a heap-allocated secure secret.
- dynamic_
generic_ alias - Creates a generic heap-allocated secure secret type alias.
- fixed_
alias - Creates a type alias for a fixed-size secure secret.
- fixed_
alias_ random - Creates a type alias for a random-only fixed-size secret.
- fixed_
generic_ alias - Creates a generic (const-sized) fixed secure buffer type.
Structs§
- Dynamic
- Re-export of the
Dynamictype. Heap-allocated secure secret wrapper. - Fixed
- Re-export of the
Fixedtype. Stack-allocated secure secret wrapper. - From
Slice Error - Re-export of the
FromSliceErrortype. Error for slice length mismatches in TryFrom impls.
Enums§
- Bech32
Encoding Error - Re-export of
Bech32EncodingErrorfor convenience when using bech32 encoding. Error type for Bech32 encoding operations.
Traits§
- Clone
Safe - Re-export of the
CloneSafetrait. Marker trait enabling safe cloning of secrets. - Constant
Time Eq - Re-export of the
ConstantTimeEqtrait. Trait for constant-time equality comparison to prevent timing attacks. - Expose
Secret - Re-export of the traits. Trait for read-only access to secrets, including metadata.
- Expose
Secret Mut - Re-export of the traits. Trait for mutable access to secrets.
- Secure
Encoding - Re-export of
SecureEncodingtrait for convenient encoding extensions. Re-export of theSecureEncodingtrait. Extension trait for safe, explicit encoding of secret byte data to strings. - Secure
Random - Re-export of SecureRandom (requires
randfeature).