Expand description
Compatibility-oriented secret wrappers backed by sanitization.
This crate provides the familiar SecretBox, SecretSlice,
SecretString, ExposeSecret, and ExposeSecretMut API shape for projects
migrating from secrecy 0.10. It deliberately keeps reference-returning
exposure, cloning, and plaintext serialization out of the hardened
sanitization containers.
The compatibility wrapper provides redacted formatting and sanitizes its
currently boxed value on drop. It does not provide memory locking, guard
pages, storage-history recovery, or the scoped-exposure guarantees of the
native sanitization container families.
Reference exposure requires the core storage-stability contracts under
every feature combination. The hazmat-unrestricted-exposure feature adds
a visibly distinct UnrestrictedSecretBox for legacy types that cannot
satisfy those contracts; it never broadens SecretBox.
Re-exports§
pub use zeroize;
Structs§
- Secret
Box - A boxed secret value with explicit reference exposure and clearing on drop.
- Secret
Slice Capacity Error - Error returned when a no-copy vector transfer would discard capacity.
- Secret
String Seed - Deserialize a boxed secret string with an application-selected UTF-8 byte limit. The limit applies when the visitor receives text, not to parser-owned buffers.
- Unrestricted
Secret Box - Explicit reduced-assurance wrapper for legacy unrestricted exposure.
Enums§
- Secret
Slice Allocation Error - Error returned while allocating final storage for a runtime-length secret slice.
- Secret
Slice Init Error - Error returned by fallible runtime-length secret-slice initialization.
- Secret
String Utf8 Error - Error ingesting owned bytes as bounded secret text. Never retains input bytes.
Traits§
- Cloneable
Secret - Marker for secret values whose owners explicitly permit duplication.
- Expose
Secret - Expose a shared reference to an inner secret.
- Expose
Secret Mut - Expose a mutable reference to an inner secret.
- Serializable
Secret - Marker for secret values whose owners explicitly permit plaintext Serde serialization.
Type Aliases§
- Secret
Slice - A boxed secret slice.
- Secret
String - A boxed UTF-8 secret string.
- Secret
String Build Error - Byte-limit and exact-allocation errors for boxed UTF-8 text.