pub struct SignatureVerifier { /* private fields */ }Available on crate feature
signatures only.Expand description
Verifier for PDF digital signatures.
Implementations§
Source§impl SignatureVerifier
impl SignatureVerifier
Sourcepub fn add_trusted_root(&mut self, cert_der: Vec<u8>)
pub fn add_trusted_root(&mut self, cert_der: Vec<u8>)
Add a trusted root certificate.
Sourcepub fn add_trusted_roots(&mut self, certs: Vec<Vec<u8>>)
pub fn add_trusted_roots(&mut self, certs: Vec<Vec<u8>>)
Add multiple trusted root certificates.
Sourcepub fn load_system_roots(&mut self) -> Result<usize>
pub fn load_system_roots(&mut self) -> Result<usize>
Load system root certificates.
Sourcepub fn extract_signature_info(&self, sig_dict: &Object) -> Result<SignatureInfo>
pub fn extract_signature_info(&self, sig_dict: &Object) -> Result<SignatureInfo>
Extract signature information from a signature dictionary.
Sourcepub fn verify(
&self,
pdf_data: &[u8],
sig_dict: &Object,
contents: &[u8],
) -> Result<VerificationResult>
pub fn verify( &self, pdf_data: &[u8], sig_dict: &Object, contents: &[u8], ) -> Result<VerificationResult>
Verify a signature end-to-end.
Runs the RSA-PKCS#1 v1.5 signer-attributes check and the
messageDigest content-integrity check (via
crate::signatures::verify_signer_detached), then enriches
the result with certificate trust, expiration, and DN metadata
extracted from the embedded signer certificate.
Digest algorithm is driven by the CMS blob’s signer.digest_alg
(SHA-1 / SHA-256 / SHA-384 / SHA-512), so PDFs that don’t use
SHA-256 — still common with PAdES — are covered.
Sourcepub fn quick_check(&self, sig_dict: &Object) -> Result<bool>
pub fn quick_check(&self, sig_dict: &Object) -> Result<bool>
Quick check if a signature appears valid (without full cryptographic verification).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SignatureVerifier
impl RefUnwindSafe for SignatureVerifier
impl Send for SignatureVerifier
impl Sync for SignatureVerifier
impl Unpin for SignatureVerifier
impl UnsafeUnpin for SignatureVerifier
impl UnwindSafe for SignatureVerifier
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.