Registry / crypto / secrecy

secrecy

JSON →
library0.10.3rscratesunverified

Wrapper types and traits for secret management which help ensure they aren't accidentally copied, logged, or otherwise exposed, and also ensure secrets are securely wiped from memory when dropped.

# Cargo.toml [dependencies] secrecy = "0.10.3"
INSTALL
IMPORT
SIG · SECRECY
S
secrecy
cryptorustv0.10.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Secret
use secrecy::Secret;

Creates a secret string and exposes it for printing.

use secrecy::Secret; fn main() { let secret = Secret::new("my_secret_password".to_string()); println!("Secret is: {:?}", secret.expose_secret()); }
Debug
Known issues
gotchaExposing secrets via Debug or Display may leak them.
fix
Avoid printing secrets directly; use `expose_secret()` only when necessary.
affects: >=0.1.0
Upgrade
Version history
0.10.3latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Amazon
1
Resources
secrecy — cargo add secrecy · libregistry