pub struct Signature {Show 19 fields
pub field_name: String,
pub filter: Option<String>,
pub sub_filter: Option<String>,
pub name: Option<String>,
pub signing_time: Option<String>,
pub location: Option<String>,
pub reason: Option<String>,
pub contact_info: Option<String>,
pub coverage: ByteRangeCoverage,
pub digest: DigestStatus,
pub crypto: CryptoStatus,
pub digest_algorithm: Option<String>,
pub signature_algorithm: Option<String>,
pub signer_common_name: Option<String>,
pub cms_blob: Option<Vec<u8>>,
pub has_timestamp: bool,
pub cert_count: usize,
pub has_dss: bool,
pub revocation: RevocationStatus,
}Expand description
A digital signature attached to a /Sig form field.
Fields§
§field_name: StringThe fully-qualified name of the signature field (/T chain).
filter: Option<String>/Filter — the security handler that produced the signature
(conventionally Adobe.PPKLite).
sub_filter: Option<String>/SubFilter — the encoding of the signed data, e.g.
adbe.pkcs7.detached, adbe.pkcs7.sha1, or ETSI.CAdES.detached
(PAdES).
name: Option<String>/Name — the signer’s name as declared in the dictionary (not
cryptographically bound; see Signature::signer_common_name).
signing_time: Option<String>/M — the signing time, as the raw PDF date string.
location: Option<String>/Location.
reason: Option<String>/Reason.
contact_info: Option<String>/ContactInfo.
coverage: ByteRangeCoverageThe signed spans of the file (/ByteRange) and what they cover.
digest: DigestStatusResult of comparing the recomputed digest of the covered bytes to the digest embedded in the CMS blob.
crypto: CryptoStatusResult of verifying the signer’s public-key signature over the CMS signed attributes, using the first embedded certificate’s public key.
digest_algorithm: Option<String>Human name of the digest algorithm named by the CMS SignerInfo
(SHA-1, SHA-256, …), when it could be identified.
signature_algorithm: Option<String>Human name of the signature (public-key) algorithm identified from the
CMS SignerInfo and the signer certificate (RSA, ECDSA (P-256), …),
when it could be identified.
signer_common_name: Option<String>The Common Name (CN) of the first certificate in the CMS blob —
typically, but not guaranteed to be, the signer’s leaf certificate.
Best-effort; None when no certificate / CN could be extracted.
cms_blob: Option<Vec<u8>>The raw CMS SignedData blob (/Contents), for follow-up checks such
as certificate-chain verification (crate::trust). None when the
dictionary carried no string /Contents.
has_timestamp: boolTrue when the CMS carries an RFC 3161 timestamp token in its
unsignedAttrs (a signature-time-stamp attribute). Best-effort
detection by OID scan; the TSA signature itself is not verified.
cert_count: usizeNumber of certificates embedded in the CMS certificates set (the
signer cert plus any chain), best-effort.
has_dss: boolWhether the document carries a /DSS (Document Security Store) on its
catalog — certs/CRLs/OCSP for LTV. None resolution falls back to false.
revocation: RevocationStatusOffline revocation status derived from CRLs embedded in the CMS or the
/DSS. No network fetching is performed.
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn is_cryptographically_valid(&self) -> bool
pub fn is_cryptographically_valid(&self) -> bool
True only when both checks pass: the signed bytes are intact
(DigestStatus::Verified) and the signer’s signature over the
signed attributes verifies against the embedded certificate’s public key
(CryptoStatus::Valid).
This still does not establish trust: the certificate is not validated
against any anchor, nor checked for revocation. A true here means
“cryptographically sound, from the private key matching the embedded
certificate” — the certificate’s trustworthiness is a separate,
out-of-scope question.