Module credentials

Module credentials 

Source
Expand description

Secure credential types with automatic memory zeroization.

All sensitive data is automatically cleared from memory when dropped, preventing credential leakage through memory dumps or core files.

§Security

This module provides types that implement the Zeroize and ZeroizeOnDrop traits from the zeroize crate. When these types go out of scope, their memory is securely overwritten with zeros before being deallocated.

§Example

use ccxt_core::credentials::SecretString;

let api_key = SecretString::new("my-api-key");

// Access the secret when needed
let key_value = api_key.expose_secret();

// Debug output is redacted
println!("{:?}", api_key); // Prints: [REDACTED]

// When api_key goes out of scope, memory is automatically zeroed

Structs§

SecretBytes
Secure bytes that are automatically zeroed when dropped.
SecretString
A secure string that is automatically zeroed when dropped.