Simple ASN.1 definition:
BEGIN
A ::= SEQUENCE {
i OCTET STRING (SIZE(3)),
t OCTET STRING (SIZE(2)),
e INTEGER OPTIONAL,
...
}
END
Resulting in:
#[derive(AsnType, Debug, Clone, Decode, Encode, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub struct A {
pub i: FixedOctetString<3>,
pub t: FixedOctetString<2>,
pub e: Option<Integer>,
}
APER encoder properly encodes the following SEQUENCE:
let original = A {
i: FixedOctetString::from([0x19, 0xf0, 0x45]),
t: FixedOctetString::from([0x00, 0x01]),
e: None,
};
Result is -> [0x00, 0x19, 0xf0, 0x45, 0x00, 0x01]
Howerver, APER decoder fails to properly decode -> after reading SEQUENCE header the input is not byte-aligned!