ser_der 0.0.0

Newtypes for the der crate to allow for serde de-/serialization
Documentation
  • Coverage
  • 0%
    0 out of 1 items documented0 out of 0 items with examples
  • Size
  • Source code size: 24.78 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 228.98 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 21s Average build duration of successful builds.
  • all releases: 21s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • bitfl0wer

ser_der

Newtypes for the der crate to allow for serde de-/serialization.

Usage

Add this to your Cargo.toml:

[dependencies]
ser_der = { version = "0", features = ["alloc"] } # Features should match the ones of the der crate
der = { version = "0", features = ["alloc"] } 
serde = { version = "1", features = ["derive"] }

You can then use the newtypes offered by this crate to de-/serialize DER-encoded data structures using serde.

#[derive(serde::Serialize, serde::Deserialize)]
struct MyStruct {
    #[serde(with = "ser_der::asn1::ia5_string")]
    bits: ser_der::asn1::IA5String,
}

All newtypes implement Deref, DerefMut, From<[Newtype]> for [Type] and From<[Type]> for [Newtype] to the underlying der type.

Upstreaming to der

This crate is a temporary solution until the der crate supports serde de-/serialization. The plan is to upstream the serde support to the der crate.