-
Notifications
You must be signed in to change notification settings - Fork 176
Expand file tree
/
Copy pathencapsulated_content_info.rs
More file actions
29 lines (26 loc) · 995 Bytes
/
encapsulated_content_info.rs
File metadata and controls
29 lines (26 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//! `encapsulated-data` content type [RFC 5652 § 5.2](https://datatracker.ietf.org/doc/html/rfc5652#section-5.2)
use der::{AnyRef, Sequence};
use spki::ObjectIdentifier;
/// Encapsulated content information [RFC 5652 § 5.2](https://datatracker.ietf.org/doc/html/rfc5652#section-5.2)
///
/// ```text
/// EncapsulatedContentInfo ::= SEQUENCE {
/// eContentType ContentType,
/// eContent [0] EXPLICIT OCTET STRING OPTIONAL }
/// ```
/// Due to a difference in PKCS #7 and CMS the contents type can be either
/// ```text
/// content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL
/// ```
/// or
/// ```text
/// eContent [0] EXPLICIT OCTET STRING OPTIONAL
/// ```
#[derive(Clone, Copy, Debug, Eq, PartialEq, Sequence)]
pub struct EncapsulatedContentInfo<'a> {
/// indicates the type of content.
pub e_content_type: ObjectIdentifier,
/// encapsulated content
#[asn1(context_specific = "0", optional = "true", tag_mode = "EXPLICIT")]
pub e_content: Option<AnyRef<'a>>,
}