pub struct SignedData<'a> {
pub content: &'a [u8],
pub signer_key_id: [u8; 20],
pub signature: Signature,
}rustcrypto only.Expand description
A parsed CMS SignedData carrying a Certification Declaration (RFC 5652 §5).
Only the profile §6.3.1 permits is accepted: version 3, a single SHA-256 digest
algorithm, pkcs7-data content, one signer identified by Subject Key Identifier, and
ECDSA-with-SHA256. Anything broader would be a parser for CMS rather than for a CD, with
a correspondingly larger attack surface for no benefit.
Fields§
§content: &'a [u8]The eContent octets — the TLV of CertificationElements, and the exact bytes the
signature covers.
signer_key_id: [u8; 20]The signer’s Subject Key Identifier, which names a CSA key the commissioner must already hold.
signature: SignatureThe signature, converted from the DER ECDSA-Sig-Value to the r || s of §3.5.3.
Implementations§
Source§impl<'a> SignedData<'a>
impl<'a> SignedData<'a>
Sourcepub fn verify(&self, csa_public_key: &PublicKey) -> Result<bool>
pub fn verify(&self, csa_public_key: &PublicKey) -> Result<bool>
Verifies the signature against a CSA signing key.
The caller supplies the key, because a CD names its signer only by key identifier and the set of trusted CSA keys is the commissioner’s policy, not this crate’s.
Sourcepub fn elements(&self) -> Result<CertificationElements<'a>>
pub fn elements(&self) -> Result<CertificationElements<'a>>
Parses the eContent as certification elements.