Replies: 2 comments 2 replies
-
I think this is something what you would need to write yourself in Rust. Value notation here is to program ASN.1 as Rust. E.g. from the second link
Simplified assumed sample objects and corresponding usage: #[derive(AsnType, Decode, Encode, Clone, Copy, Debug, PartialEq)]
#[rasn(enumerated, automatic_tags)]
pub enum Fuel {
Solid,
Liquid,
Gas,
}
#[derive(AsnType, Decode, Encode, Clone, Debug, PartialEq)]
#[rasn(automatic_tags)]
pub struct Speed {
pub mph: Integer,
}
#[derive(AsnType, Decode, Encode, Clone, Debug, PartialEq)]
#[rasn(automatic_tags)]
pub struct Rocket {
pub name: Utf8String,
pub fuel: Fuel,
pub speed: Speed,
pub payload: Vec<Utf8String>,
}
let rocket = Rocket {
name: "Falcon".to_string(),
fuel: Fuel::Solid,
speed: Speed { mph: 18000 },
payload: vec!["Car".to_string(), "GPS".to_string()],
}; Now you can encode Check this PR for more examples: |
Beta Was this translation helpful? Give feedback.
2 replies
-
Thank you for question, there isn't support right now, but I'm not opposed to accepting a contribution adding support for encoding values into that notation. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I couldn't find any reference regarding the support for ASN.1 value notation. To the human, it looks rather similar to the textual representation of JSER or GSER. However, it is syntactically different.
There are standards/interfaces where data is exchanged in ASN.1 value notation, and hence it is needed to encode/decode that notation. One can look at it as yet another set of encoding rules.
References:
Is this something that rasn supports or plans to support? Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions