-
Couldn't load subscription status.
- Fork 167
Closed
Description
Hello dear all,
sorry for my newb question. I wanted to know, if there is a possibility to decode (and possibly encode) something like this for der:
Identifier ::= [APPLICATION 328] CHOICE {
hash_over_key OCTET STRING (SIZE(8))
}
I tried with deriving Choice:
#[derive(Choice)]
pub enum Identifier<'a> {
#[asn1(type = "OCTET STRING")]
HashOverKey(OctetStringRef<'a>),
}
// This is currently not possible due to conflicting trait implementations
impl FixedTag for Identifier<'_> {
const TAG: Tag = Tag::Application {
constructed: true,
number: TagNumber(328),
};
}But sadly FixedTag is already implemented by a blank implementation of Choice. I've seen a similar solved issue with Sequence, which was solved by deriving DecodeValue and EncodeValue and then manully implementing FixedTag: see here
Do you see any possibility to achieve something similar with Choice?
Metadata
Metadata
Assignees
Labels
No labels