Crate secure_gate

Crate secure_gate 

Source
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 zeroize feature). 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 Dynamic type. Heap-allocated secure secret wrapper.
Fixed
Re-export of the Fixed type. Stack-allocated secure secret wrapper.
FromSliceError
Re-export of the FromSliceError type. Error for slice length mismatches in TryFrom impls.

Enums§

Bech32EncodingError
Re-export of Bech32EncodingError for convenience when using bech32 encoding. Error type for Bech32 encoding operations.

Traits§

CloneSafe
Re-export of the CloneSafe trait. Marker trait enabling safe cloning of secrets.
ConstantTimeEq
Re-export of the ConstantTimeEq trait. Trait for constant-time equality comparison to prevent timing attacks.
ExposeSecret
Re-export of the traits. Trait for read-only access to secrets, including metadata.
ExposeSecretMut
Re-export of the traits. Trait for mutable access to secrets.
SecureEncoding
Re-export of SecureEncoding trait for convenient encoding extensions. Re-export of the SecureEncoding trait. Extension trait for safe, explicit encoding of secret byte data to strings.
SecureRandom
Re-export of SecureRandom (requires rand feature).