Expand description
CMS (RFC 5652) — Cryptographic Message Syntax.
CmsContentInfo wraps CMS_ContentInfo* and covers the SignedData
content type used in modern PKI: signing a payload with an X.509 certificate,
verifying a signed message against a trust store, and extracting the embedded
certificates and CRLs.
§Quick example
let payload = b"hello, PKINIT";
let signed = CmsContentInfo::sign(cert, key, &[], payload, CmsSignFlags::NONE)?;
let der = signed.to_der()?;
let parsed = CmsContentInfo::from_der(&der)?;
let content = parsed.verify(store, &[], CmsVerifyFlags::NONE)?;
assert_eq!(content, payload);Structs§
- CmsContent
Info - An owned
CMS_ContentInfo*— the top-level CMS container. - CmsSign
Flags - Flags that control
CmsContentInfo::sign. - CmsSigner
Info - A borrowed reference to a
CMS_SignerInfowithin aCmsContentInfo. - CmsVerify
Flags - Flags that control
CmsContentInfo::verify.