{"id":22820157,"url":"https://github.com/kizzycode/serde_asn1_der-rust","last_synced_at":"2026-02-25T07:03:13.830Z","repository":{"id":57666655,"uuid":"177420698","full_name":"KizzyCode/serde_asn1_der-rust","owner":"KizzyCode","description":"An ASN.1-DER subset for serde","archived":false,"fork":false,"pushed_at":"2023-03-07T18:33:43.000Z","size":83,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-18T01:41:33.667Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KizzyCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE BSD 2-CLAUSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-24T13:46:38.000Z","updated_at":"2023-08-25T22:05:05.000Z","dependencies_parsed_at":"2022-09-26T20:31:52.700Z","dependency_job_id":null,"html_url":"https://github.com/KizzyCode/serde_asn1_der-rust","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KizzyCode%2Fserde_asn1_der-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KizzyCode%2Fserde_asn1_der-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KizzyCode%2Fserde_asn1_der-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KizzyCode%2Fserde_asn1_der-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KizzyCode","download_url":"https://codeload.github.com/KizzyCode/serde_asn1_der-rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250345090,"owners_count":21415249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-12T15:16:44.202Z","updated_at":"2026-02-25T07:03:08.793Z","avatar_url":"https://github.com/KizzyCode.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![docs.rs](https://docs.rs/serde_asn1_der/badge.svg)](https://docs.rs/serde_asn1_der)\n[![License BSD-2-Clause](https://img.shields.io/badge/License-BSD--2--Clause-blue.svg)](https://opensource.org/licenses/BSD-2-Clause)\n[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![crates.io](https://img.shields.io/crates/v/serde_asn1_der.svg)](https://crates.io/crates/serde_asn1_der)\n[![Download numbers](https://img.shields.io/crates/d/serde_asn1_der.svg)](https://crates.io/crates/serde_asn1_der)\n[![Travis CI](https://travis-ci.org/KizzyCode/serde_asn1_der-rust.svg?branch=master)](https://travis-ci.org/KizzyCode/serde_asn1_der-rust)\n[![AppVeyor CI](https://ci.appveyor.com/api/projects/status/github/KizzyCode/serde_asn1_der-rust?svg=true)](https://ci.appveyor.com/project/KizzyCode/serde-asn1-der-rust)\n[![dependency status](https://deps.rs/crate/serde_asn1_der/0.8.0/status.svg)](https://deps.rs/crate/serde_asn1_der/0.8.0)\n\n\n# serde_asn1_der\nWelcome to `serde_asn1_der` 🎉\n\nThis crate implements an ASN.1-DER subset for serde based upon\n[`asn1_der`](https://crates.io/crates/asn1_der).\n\nThe following types are supported:\n - `bool`: The ASN.1-BOOLEAN-type\n - `u8`, `u16`, `u32`, `u64`, `u128`, `usize`: The ASN.1-INTEGER-type\n - `()`, `Option`: The ASN.1-NULL-type\n - `\u0026[u8]`, `Vec\u003cu8\u003e`: The ASN.1-OctetString-type\n - `\u0026str`, `String`: The ASN.1-UTF8String-type\n - And everything sequence-like combined out of this types\n\nWith the `serde_derive`-crate you can derive `Serialize` and `Deserialize` for all non-primitive\nelements:\n```rust\nuse serde_derive::{ Serialize, Deserialize };\n\n#[derive(Serialize, Deserialize)] // Now our struct supports all DER-conversion-traits\nstruct Address {\n    street: String,\n    house_number: u128,\n    postal_code: u128,\n    state: String,\n    country: String\n}\n\n#[derive(Serialize, Deserialize)] // Now our struct supports all DER-conversion-traits too\nstruct Customer {\n    name: String,\n    e_mail_address: String,\n    postal_address: Address\n}\n```\n\n\n# Example\n```rust\nuse serde_asn1_der::{ to_vec, from_bytes };\nuse serde_derive::{ Serialize, Deserialize };\n\n#[derive(Serialize, Deserialize)]\nstruct TestStruct {\n    number: u8,\n    #[serde(with = \"serde_bytes\")]\n    vec: Vec\u003cu8\u003e,\n    tuple: (usize, ())\n}\n\nfn main() {\n    let plain = TestStruct{ number: 7, vec: b\"Testolope\".to_vec(), tuple: (4, ()) };\n    let serialized = to_vec(\u0026plain).unwrap();\n    let deserialized: TestStruct = from_bytes(\u0026serialized).unwrap();\n}\n```\n\n\n# `AnyObject`\nThis crate also offers a type-erased `AnyObject`-trait, that allows you to use `Box\u003cdyn AnyObject\u003e`\ninstead of a specific type. To enable `AnyObject`, use the `\"any\"`-feature.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkizzycode%2Fserde_asn1_der-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkizzycode%2Fserde_asn1_der-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkizzycode%2Fserde_asn1_der-rust/lists"}