pub struct SignatureHashInputs<'s> { /* private fields */ }Expand description
Inputs needed to calculate a specific signature hash for a specific Item
Embodies:
-
&strfor the body, as forSignedDocumentBody. For calculating Orderly signatures. (That is, ones that do not include any part of the signature Item; See [SignedDocumentBody].) -
Extra information for calculating Disorderly signatures. Disorderly signature Items can only be implemented within this crate.
Implementations§
Source§impl<'s> SignatureHashInputs<'s>
impl<'s> SignatureHashInputs<'s>
Sourcepub fn body(&self) -> SignedDocumentBody<'s>
pub fn body(&self) -> SignedDocumentBody<'s>
Method returning copy of SignatureHashInputs::body field.
The Orderly body (up to the first signature item)
Source§impl<'s> SignatureHashInputs<'s>
impl<'s> SignatureHashInputs<'s>
Sourcepub fn new_for_signature(
document_body: &'s str,
signature_item_kw_line: &'s str,
) -> Self
pub fn new_for_signature( document_body: &'s str, signature_item_kw_line: &'s str, ) -> Self
Create a new SignatureHashInputs given an in-progress document, for making a signature
For use by the specific “make a signature” methods for each document type.
Prefer to use
crate::types::RsaSha1Signature::new_sign_netdoc
when applicable.
-
document_bodyis the whole of the document body - ie, the whole of the unsigned part, not including any part of any signature items. -
signature_item_kw_lineis the keyword line for the signature item that we are trying to create.
Different signatures on the same document might need different SignatureHashInputs.
§Keyword item line
How signature_item_kw_line is used, and what it must contain,
depends on the signature hashing approach.
Sometimes it does not need to be the whole item keyword line.
If the signature hashing approach wants the whole item keyword line, then it must indeed be that whole line, including the trailing newline.
If the signature hashing approach only wants the item-keyword-space, then it is OK to pass only that item-keyword-space; a whole line can be passed, but if the same hashing code is used as in parsing/verification, everything after the space will then be ignored, so need not actually be present.
It’s usually difficult to avoid duplicating the knowledge of the encoding. Passing a fixed literal string is acceptable, even though that recapitulates the item keyword,
Trait Implementations§
Source§impl<'s> Clone for SignatureHashInputs<'s>
impl<'s> Clone for SignatureHashInputs<'s>
impl<'s> Copy for SignatureHashInputs<'s>
Source§impl<'s> Debug for SignatureHashInputs<'s>
impl<'s> Debug for SignatureHashInputs<'s>
impl<'s> Eq for SignatureHashInputs<'s>
Source§impl<'s> Hash for SignatureHashInputs<'s>
impl<'s> Hash for SignatureHashInputs<'s>
Source§impl<'s> PartialEq for SignatureHashInputs<'s>
impl<'s> PartialEq for SignatureHashInputs<'s>
impl<'s> StructuralPartialEq for SignatureHashInputs<'s>
Auto Trait Implementations§
impl<'s> Forget for SignatureHashInputs<'s>
impl<'s> Freeze for SignatureHashInputs<'s>
impl<'s> Move for SignatureHashInputs<'s>
impl<'s> RefUnwindSafe for SignatureHashInputs<'s>
impl<'s> Send for SignatureHashInputs<'s>
impl<'s> Sync for SignatureHashInputs<'s>
impl<'s> Unpin for SignatureHashInputs<'s>
impl<'s> UnsafeUnpin for SignatureHashInputs<'s>where
&'s str: UnsafeUnpin,
impl<'s> UnwindSafe for SignatureHashInputs<'s>where
&'s str: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 more