cms/
encrypted_data.rs

1//! EncryptedData-related types
2use der::Sequence;
3
4use x509_cert::attr::Attributes;
5
6use crate::content_info::CmsVersion;
7use crate::enveloped_data::EncryptedContentInfo;
8
9/// The `EncryptedData` type is defined in [RFC 5652 Section 8].
10///
11/// ```text
12///   EncryptedData ::= SEQUENCE {
13///       version CMSVersion,
14///       encryptedContentInfo EncryptedContentInfo,
15///       ...,
16///       [[2: unprotectedAttrs [1] IMPLICIT Attributes
17///           {{UnprotectedEncAttributes}} OPTIONAL ]] }
18/// ```
19///
20/// [RFC 5652 Section 8]: https://www.rfc-editor.org/rfc/rfc5652#section-8
21#[derive(Clone, Debug, Eq, PartialEq, Sequence)]
22#[allow(missing_docs)]
23pub struct EncryptedData {
24    pub version: CmsVersion,
25    pub enc_content_info: EncryptedContentInfo,
26    #[asn1(
27        context_specific = "1",
28        tag_mode = "IMPLICIT",
29        constructed = "true",
30        optional = "true"
31    )]
32    pub unprotected_attrs: Option<Attributes>,
33}