#[non_exhaustive]pub struct SignatureInput {
pub components: Vec<Component>,
pub keyid: Option<String>,
pub algorithm: Option<String>,
pub created: Option<i64>,
pub expires: Option<i64>,
pub nonce: Option<String>,
pub tag: Option<String>,
}Expand description
One entry of the Signature-Input: dictionary: the ordered component
list plus parameters.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.components: Vec<Component>Components covered by the signature, in signing order.
keyid: Option<String>keyid= parameter (mandatory for ActivityPub use).
algorithm: Option<String>alg= parameter hint; None means “detect from the resolved key”.
created: Option<i64>created= parameter in seconds since the UNIX epoch.
expires: Option<i64>expires= parameter in seconds since the UNIX epoch.
nonce: Option<String>nonce= parameter as emitted by the signer, opaque to us.
tag: Option<String>tag= parameter as emitted by the signer, opaque to us.
Implementations§
Source§impl SignatureInput
impl SignatureInput
Sourcepub const fn new(components: Vec<Component>) -> Self
pub const fn new(components: Vec<Component>) -> Self
Creates a SignatureInput covering the given components, with
every optional parameter left unset. Use the with_* builders
below to populate keyid, created, expires, nonce and
tag as needed.
Sourcepub fn with_keyid(self, keyid: impl Into<String>) -> Self
pub fn with_keyid(self, keyid: impl Into<String>) -> Self
Sets the keyid= parameter.
Sourcepub fn with_algorithm(self, algorithm: impl Into<String>) -> Self
pub fn with_algorithm(self, algorithm: impl Into<String>) -> Self
Sets the alg= parameter.
Sourcepub const fn with_created(self, created: i64) -> Self
pub const fn with_created(self, created: i64) -> Self
Sets the created= parameter (seconds since UNIX epoch).
Sourcepub const fn with_expires(self, expires: i64) -> Self
pub const fn with_expires(self, expires: i64) -> Self
Sets the expires= parameter (seconds since UNIX epoch).
Sourcepub fn with_nonce(self, nonce: impl Into<String>) -> Self
pub fn with_nonce(self, nonce: impl Into<String>) -> Self
Sets the nonce= parameter.
Sourcepub fn serialise_inner_list(&self) -> String
pub fn serialise_inner_list(&self) -> String
Serialises this entry as the inner-list-with-parameters portion
that appears after label=. The full header value is built by
serialise_signature_input_dict.
§Panics
Panics only if sfv fails to serialise a well-formed inner list;
this is unreachable for the inputs we construct.
Trait Implementations§
Source§impl Clone for SignatureInput
impl Clone for SignatureInput
Source§fn clone(&self) -> SignatureInput
fn clone(&self) -> SignatureInput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SignatureInput
impl Debug for SignatureInput
Source§impl PartialEq for SignatureInput
impl PartialEq for SignatureInput
impl Eq for SignatureInput
impl StructuralPartialEq for SignatureInput
Auto Trait Implementations§
impl Freeze for SignatureInput
impl RefUnwindSafe for SignatureInput
impl Send for SignatureInput
impl Sync for SignatureInput
impl Unpin for SignatureInput
impl UnsafeUnpin for SignatureInput
impl UnwindSafe for SignatureInput
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.