cmpv2/gen.rs
1//! General purpose message-related types
2
3use der::{Sequence, ValueOrd};
4use x509_cert::attr::{AttributeType, AttributeValue};
5
6/// The `InfoTypeAndValue` type is defined in [RFC 4210 Section 5.3.19]
7///
8/// ```text
9/// InfoTypeAndValue ::= SEQUENCE {
10/// infoType INFO-TYPE-AND-VALUE.
11/// &id({SupportedInfoSet}),
12/// infoValue INFO-TYPE-AND-VALUE.
13/// &Type({SupportedInfoSet}{@infoType}) }
14/// ```
15///
16/// [RFC 4210 Section 5.3.19]: https://www.rfc-editor.org/rfc/rfc4210#section-5.3.19
17#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Sequence, ValueOrd)]
18#[allow(missing_docs)]
19pub struct InfoTypeAndValue {
20 pub oid: AttributeType,
21 pub value: Option<AttributeValue>,
22}
23
24/// The `GenMsgContent` type is defined in [RFC 4210 Section 5.3.19]
25///
26/// ```text
27/// GenMsgContent ::= SEQUENCE OF InfoTypeAndValue
28/// ```
29///
30/// [RFC 4210 Section 5.3.19]: https://www.rfc-editor.org/rfc/rfc4210#section-5.3.19
31pub type GenMsgContent = alloc::vec::Vec<InfoTypeAndValue>;
32
33/// The `GenRepContent` type is defined in [RFC 4210 Section 5.3.20]
34///
35/// ```text
36/// GenRepContent ::= SEQUENCE OF InfoTypeAndValue
37/// ```
38///
39/// [RFC 4210 Section 5.3.20]: https://www.rfc-editor.org/rfc/rfc4210#section-5.3.20
40pub type GenRepContent = alloc::vec::Vec<InfoTypeAndValue>;