#[non_exhaustive]pub struct SignOptions { /* private fields */ }Expand description
Options for signing a document.
Implementations§
Source§impl SignOptions
impl SignOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
New options with PadesProfile::BasicSignature as default.
Sourcepub fn contact_info(self, v: impl Into<String>) -> Self
pub fn contact_info(self, v: impl Into<String>) -> Self
Signer contact information.
Sourcepub fn field_name(self, v: impl Into<String>) -> Self
pub fn field_name(self, v: impl Into<String>) -> Self
Signature form field name. Defaults to Signature1.
Sourcepub fn visible_rect(self, page: usize, rect: [f64; 4]) -> Self
pub fn visible_rect(self, page: usize, rect: [f64; 4]) -> Self
Place a visible signature appearance on a specific page.
Sourcepub fn revocation_data(
self,
ocsp_responses: Vec<Vec<u8>>,
crls: Vec<Vec<u8>>,
) -> Self
pub fn revocation_data( self, ocsp_responses: Vec<Vec<u8>>, crls: Vec<Vec<u8>>, ) -> Self
Revocation evidence for the DSS, DER-encoded.
PAdES B-LT is the profile that lets a verifier check the signature years later without going back on the network, and that takes more than the certificate chain: it takes the evidence that those certificates were not revoked at signing time. Fetching it is the caller’s, because the engine makes no network call while signing.
Include what covers the signer’s chain, and the timestamp authority’s
chain as well if you have it – a verifier offline in five years checks
both. PadesProfile::LongTerm is refused without any of it, rather
than writing a DSS that names the profile and cannot support it.
Sourcepub fn profile(self, p: PadesProfile) -> Self
pub fn profile(self, p: PadesProfile) -> Self
Select the PAdES profile.
PadesProfile::Timestamped and PadesProfile::LongTerm have to be
signed through
PdfDocument::sign_timestamped,
which fetches the token over the signature it just made.
Sourcepub fn timestamp_token(self, der: impl Into<Vec<u8>>) -> Self
pub fn timestamp_token(self, der: impl Into<Vec<u8>>) -> Self
Supply a DER-encoded RFC 3161 timestamp token you already hold.
Only a token over this document’s signature will be accepted, and a
token obtained before signing cannot be one: the signature does not
exist yet, so its digest cannot be in the token’s messageImprint.
PdfDocument::sign refuses a token that
stamps other bytes rather than writing a B-T claim that no verifier will
accept (#515).
So this method is for the case where the token genuinely is about this
signature – one carried across a process boundary, say. To fetch a
token in the ordinary way, use
PdfDocument::sign_timestamped,
which sequences the two correctly. The engine deliberately has no HTTP
client of its own (that is what keeps document content off the network),
so talking to the authority stays the caller’s job either way.
Ignored for PadesProfile::BasicSignature, which carries no
timestamp by definition.
Trait Implementations§
Source§impl Clone for SignOptions
impl Clone for SignOptions
Source§impl Debug for SignOptions
impl Debug for SignOptions
Auto Trait Implementations§
impl Freeze for SignOptions
impl RefUnwindSafe for SignOptions
impl Send for SignOptions
impl Sync for SignOptions
impl Unpin for SignOptions
impl UnsafeUnpin for SignOptions
impl UnwindSafe for SignOptions
Blanket Implementations§
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
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreimpl<T> ParallelSend for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
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>
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
T, using the provided data to resolve any offsets.