//! CMS SignedData (RFC 5652) as PDF signatures use it: detached (`adbe.pkcs7.detached`, //! `ETSI.CAdES.detached`) or with the digest encapsulated (`adbe.pkcs7.sha1`). use crate::Error; use crate::der::{self, Time, Tlv, tag}; use crate::keys::{DigestAlg, PrivateKey, Scheme, signature_algorithm}; use crate::x509::Certificate; pub const SIGNED_DATA: &str = "1.2.840.113549.1.7.2"; pub const DATA: &str = "1.2.840.113549.1.7.1"; const CONTENT_TYPE: &str = "1.2.840.113549.1.9.3"; const MESSAGE_DIGEST: &str = "1.2.840.113549.1.9.4"; const SIGNING_TIME: &str = "1.2.840.113549.1.9.5"; const SIGNING_CERT_V2: &str = "1.2.840.113549.1.9.16.2.47"; const SIGNING_CERT: &str = "1.2.840.113549.1.9.16.2.12"; const TIMESTAMP_TOKEN: &str = "1.2.840.113549.1.9.16.2.14"; /// How a signer names its certificate. #[derive(Clone, Debug, PartialEq, Eq)] pub enum SignerId { IssuerSerial { issuer: Vec, serial: Vec }, KeyId(Vec), } #[derive(Clone, Debug, PartialEq, Eq)] pub struct SignerInfo { pub sid: SignerId, pub digest: DigestAlg, /// The signed attributes as the SET that was signed (`None`: the signature covers the /// content itself). pub signed_attrs: Option>, pub message_digest: Option>, pub content_type: Option, pub signing_time: Option