https://github.com/alex/rust-asn1
  
  
    A Rust ASN.1 (DER) serializer. 
    https://github.com/alex/rust-asn1
  
        Last synced: 6 months ago 
        JSON representation
    
A Rust ASN.1 (DER) serializer.
- Host: GitHub
 - URL: https://github.com/alex/rust-asn1
 - Owner: alex
 - License: bsd-3-clause
 - Created: 2015-07-18T13:07:15.000Z (over 10 years ago)
 - Default Branch: main
 - Last Pushed: 2025-05-02T17:03:37.000Z (6 months ago)
 - Last Synced: 2025-05-13T17:17:32.287Z (6 months ago)
 - Language: Rust
 - Size: 695 KB
 - Stars: 118
 - Watchers: 6
 - Forks: 30
 - Open Issues: 9
 - 
            Metadata Files:
            
- Readme: README.md
 - License: LICENSE
 
 
Awesome Lists containing this project
- awesome-rust-cn - alex/rust-asn1 - ci.org/alex/rust-asn1.svg?branch=master">](https://travis-ci.org/alex/rust-asn1) (Libraries / Encoding)
 - awesome-rust - alex/rust-asn1 - ci.org/alex/rust-asn1.svg?branch=master">](https://travis-ci.org/alex/rust-asn1) (Libraries / Encoding)
 - awesome-rust - alex/rust-asn1
 - awesome-rust-cn - alex/rust-asn1
 - awesome-rust - alex/rust-asn1 - ASN.1 (DER) serializer (Libraries / Encoding)
 - awesome-rust - alex/rust-asn1 - ci.org/alex/rust-asn1.svg?branch=master">](https://travis-ci.org/alex/rust-asn1) (库 Libraries / 加密 Encoding)
 - fucking-awesome-rust - alex/rust-asn1 - ASN.1 (DER) serializer (Libraries / Encoding)
 - fucking-awesome-rust - alex/rust-asn1 - ASN.1 (DER) serializer (Libraries / Encoding)
 - awesome-rust-zh - alex/rust-asn1 - Rust ASN.1(DER)序列化器[<img src="https://api.travis-ci.org/alex/rust-asn1.svg?branch=master">](https://travis-ci.org/alex/rust-asn1) (库 / 编码(Encoding))
 
README
          # rust-asn1
[![Dependency Status][deps-rs-image]][deps-rs-link]
[![Documentation][docs-rs-image]][docs-rs-link]
This is a Rust library for parsing and generating ASN.1 data (DER only).
## Installation
Add `asn1` to your `Cargo.toml`:
```console
$ cargo add asn1
```
Builds on Rust 1.65.0 and newer.
`rust-asn1` is compatible with `#![no_std]` environments:
```console
$ cargo add asn1 --no-default-features
```
## Changelog
### [Unreleased]
#### Added
- `Parser` now exposes a `peek_tag` method that returns the tag of the next 
   element in the parse, without consuming that element.
   ([#532](https://github.com/alex/rust-asn1/pull/532))
### [0.21.0]
#### Changes
- Updated MSRV to 1.65.0.
#### Fixes
- Fixed ["perfect derives"](https://smallcultfollowing.com/babysteps/blog/2022/04/12/implied-bounds-and-perfect-derive/)
  in conjunction with `#[derive(Asn1DefinedByRead)]` and
  `#[derive(Asn1DefinedByWrite)]`.
  ([#506](https://github.com/alex/rust-asn1/pull/506))
### [0.20.0]
#### :rotating_light: Breaking changes
- Removed `Writer::{write_explicit_element, write_optional_explicit_element, write_implicit_element, write_optional_implicit_element}`.
  These can all be better accomplished with the `asn1::Explicit` and
  `asn1::Implicit` types.
#### Fixes
- Fixed ["perfect derives"](https://smallcultfollowing.com/babysteps/blog/2022/04/12/implied-bounds-and-perfect-derive/)
  in conjunction with `#[implicit]` and `#[explicit]`.
  ([#502](https://github.com/alex/rust-asn1/pull/502))
### [0.19.0]
#### :rotating_light: Breaking changes
- `GeneralizedTime` has been renamed to `X509GeneralizedTime`. The type does
  not allow fractional seconds, however this restriction is not actually a DER
  rule, it is specific to X.509.
  ([#494](https://github.com/alex/rust-asn1/pull/494))
- `GeneralizedTime` is a new type that accepts fractional seconds
  replacing the old `GeneralizedTime`.
  ([#492](https://github.com/alex/rust-asn1/pull/492))
- `#[derive(asn1::Asn1Read)]` and `#[derive(asn1::Asn1Write)]` now implement
  ["perfect derives"](https://smallcultfollowing.com/babysteps/blog/2022/04/12/implied-bounds-and-perfect-derive/).
  ([#496](https://github.com/alex/rust-asn1/pull/496))
[deps-rs-image]: https://deps.rs/repo/github/alex/rust-asn1/status.svg
[deps-rs-link]: https://deps.rs/repo/github/alex/rust-asn1
[docs-rs-image]: https://docs.rs/asn1/badge.svg
[docs-rs-link]: https://docs.rs/asn1/