base64-ng-serde
Optional serde integration for base64-ng.
The core base64-ng crate intentionally does not depend on serde. This
companion crate provides explicit wrappers for applications that already admit
serde in their dependency policy.
The wrapper types clear their initialized bytes on drop as a best-effort
retention-reduction measure, but they are still interoperability types. They
serialize bytes into visible Base64 text, clones are independent copies, and
deserialization uses the normal strict decoder rather than the ct module. Do
not use this crate as the primary path for private keys, bearer tokens, or
other fields whose malformed-input timing matters.
use Base64Standard;
let wrapped = new;
let json = to_string.unwrap;
assert_eq!;
For field-level use, prefer the explicit modules:
Available field modules are standard, standard_no_pad, url_safe,
url_safe_no_pad, mime, and pem. MIME and PEM use the strict wrapping
profiles from base64-ng; they are interoperability helpers, not
constant-time-oriented secret decoders.