rasn

repository·main·Indexed 18 days ago

https://github.com/librasn/rasn

A safe, #[no_std] ASN.1 codec framework for Rust that enables cross-encoding rule compatibility through an abstract data model. It supports a wide variety of encoding rules, including BER, CER, DER, APER, UPER, JER, OER, COER, and XER. The framework provides core traits (AsnType, Decode, Encode) and a derive macro for compile-time tag validation, allowing developers to define data types once and use them across any supported encoder or decoder.

Tokens
72.3K
Snippets
208
Records
346
Agent score
60%

What's inside rasn

  1. Overview of Rasn

    main
    Rasn (pronounced "raisin") is a safe, #[no_std] ASN.1 codec framework for Rust. It allows developers to create, share, and handle ASN.1 data types across different encoding rules. It uses an abstract codec data model, meaning you can define your data types once and use them with any supported encoder or decoder (e.g., BER, DER, CER) regardless of the underlying encoding rules.
  2. Overview of S/MIME implementation in rasn

    main

    The rasn-smime crate provides an implementation of [RFC 8551] (Secure/Multipurpose Internet Mail Extensions). It is designed to provide a consistent way to send and receive secure MIME data, supporting cryptographic security services such as authentication, message integrity, non-repudiation of origin (via digital signatures), and data confidentiality (via encryption).

    Important Note on Scope: Like other rasn core crates, this crate does not perform authentication or encryption itself. Instead, it provides the shared ASN.1 data types required to build your own S/MIME clients and servers.

  3. Overview of rasn-cms for Cryptographic Message Syntax

    main

    Cryptographic Message Syntax (CMS)

    rasn-cms provides implementations of the data types defined in the following IETF standards:

    • [RFC 4108]
    • [RFC 5083]
    • [RFC 5084]
    • [RFC 5652]

    CMS is also known as PKCS#7.

    Important Limitation: rasn-cms is not a CMS generator or validator. It is strictly a library for implementing the underlying data types required to decode and encode CMS structures using DER or BER encoding rules.

  4. Use rasn-smi for Structure of Management Information (SMI) data types

    main

    The rasn-smi crate provides implementations of ASN.1 data types defined in IETF RFC 1155 and RFC 2578 (Structure of Management Information). These definitions are designed to be transport-layer agnostic and encoding-rule agnostic, allowing them to be used with various rasn codecs like BER or DER.

    // Replace with your data.
    let data: &[u8] = &[];
    // Decode object from BER.
    let object: rasn_smi::v2::ObjectSyntax = rasn::ber::decode(&data).unwrap();
    // Encode it back into DER
    let data = rasn::der::encode(&object).unwrap();
  5. Use ATN Upper Layer Communications Service data types

    main

    The rasn-atn-ulcs crate provides the core data type implementations for the ATN Upper Layer Communications Service Protocol (ATN-ULCS).

    Note that this crate is a data-type provider only; it does not include built-in client or server implementations. To build a functional ATN-ULCS application, you must use these provided data types to construct your own client or server logic.

  6. Use Management Information Base (MIB) objects

    main

    The MIB crate provides implementations of MIB objects defined in IETF RFCs. Most types are implemented as newtype wrappers around their underlying network protocol types, ensuring zero additional memory or size overhead.

    To access metadata about an object, such as its OBJECT-TYPE information, use the smi::ObjectType trait, which provides this information statically.

  7. Use the Compressed Data Type (CDT) implementation

    main
    The rasn-cdt crate provides implementations for the data types defined in the Compressed Data Type (CDT) standard. Use this crate when you need to encode or decode data conforming to the CDT specification within the rasn ecosystem.
  8. Use Remote Device Control (H.282) data types

    main
    The rasn-h282 crate provides a complete implementation of the data types defined in the Remote Device Control (H.282) standard. Use this crate when you need to encode or decode H.282 compliant messages within a Rust application.
  9. Use ATN-CPDLC data types for ICAO 9705 implementations

    main

    The rasn-atn-cpdlc crate provides the core data types required to implement the ATN Controller–Pilot Data Link Communications Protocol (ATN-CPDLC) as defined by ICAO 9705.

    Note that this crate is a data-type provider only; it does not include a built-in client or server implementation. Developers should use these types as the foundation for building their own custom ATN-CPDLC clients or servers.

  10. Use rasn-ldap for LDAPv3 data types

    main

    The rasn-ldap crate provides a shared implementation of the data types defined in IETF RFC 4511 (LDAPv3).

    Note: This crate is not a standalone LDAP client or server. Instead, it provides the necessary ASN.1 data structures and codec logic required to build your own LDAP-compliant clients or servers.

  11. Use ITS standards implementations in rasn

    main

    The rasn ecosystem provides implementations for Intelligent Transport Systems (ITS) standards. You can use the following modules within your project:

    • ieee1609dot2: Implements the IEEE 1609.2 2022 standard.
    • ts103097: Implements the ETSI TS 103 097 standard.
  12. Use rasn-pkix for PKIX Certificate and CRL data types

    main

    The rasn-pkix crate provides implementations of the data types defined in IETF RFC 5280 (PKIX). It is designed to decode and encode certificates and Certificate Revocation Lists (CRLs) using DER encoding.

    Note: This crate is a data model implementation only. It does not provide logic for certificate generation or certificate validation.