Skip to main content

Crate sanitization_secrecy

Crate sanitization_secrecy 

Source
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§

SecretBox
A boxed secret value with explicit reference exposure and clearing on drop.
SecretSliceCapacityError
Error returned when a no-copy vector transfer would discard capacity.
SecretStringSeed
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.
UnrestrictedSecretBox
Explicit reduced-assurance wrapper for legacy unrestricted exposure.

Enums§

SecretSliceAllocationError
Error returned while allocating final storage for a runtime-length secret slice.
SecretSliceInitError
Error returned by fallible runtime-length secret-slice initialization.
SecretStringUtf8Error
Error ingesting owned bytes as bounded secret text. Never retains input bytes.

Traits§

CloneableSecret
Marker for secret values whose owners explicitly permit duplication.
ExposeSecret
Expose a shared reference to an inner secret.
ExposeSecretMut
Expose a mutable reference to an inner secret.
SerializableSecret
Marker for secret values whose owners explicitly permit plaintext Serde serialization.

Type Aliases§

SecretSlice
A boxed secret slice.
SecretString
A boxed UTF-8 secret string.
SecretStringBuildError
Byte-limit and exact-allocation errors for boxed UTF-8 text.