Skip to content

der: derive(Sequence) with heapless::Vec<u8, N> field #1732

@dishmaker

Description

@dishmaker

https://docs.rs/tinyvec/latest/tinyvec/struct.ArrayVec.html

Having stack-allocated vec fields would be nice, maybe gated behind "tinyvec" or "heapless" feature flag.

Use case:

/// EU Tachograph G2 certificate public key
#[derive(Sequence)]
#[asn1(tag_mode = "IMPLICIT")]
pub struct CertificatePublicKeyRaw {
    pub domain_parameters: ObjectIdentifier,

    /// Public point is '04 xx .. xx   yy .. yy'
    ///
    /// Maximum: 1 + 2 * 66 bytes for Nist521
    #[asn1(context_specific = "6", type = "OCTET STRING")]
    pub public_point: ArrayVec<[u8; 133]>,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions