pub struct Signature(pub String);Expand description
A wrapper around a String that represents a signature.
Tuple Fields§
§0: StringImplementations§
Source§impl Signature
impl Signature
Sourcepub fn verify_any<'a>(
&self,
public_key: &'a [PublicKey],
start_time: DateTime<Utc>,
max_age: Duration,
) -> Option<(&'a PublicKey, VerifiedSignatureHeader)>
pub fn verify_any<'a>( &self, public_key: &'a [PublicKey], start_time: DateTime<Utc>, max_age: Duration, ) -> Option<(&'a PublicKey, VerifiedSignatureHeader)>
Verifies the signature against any of the provided public keys.
Returns true if the signature is valid with one of the given
public keys and satisfies the timestamp constraints defined by start_time
and max_age.
Sourcepub fn verify(
&self,
data: &[u8],
public_key: &PublicKey,
start_time: DateTime<Utc>,
max_age_diff: Duration,
) -> Result<VerifiedSignatureHeader, SignatureError>
pub fn verify( &self, data: &[u8], public_key: &PublicKey, start_time: DateTime<Utc>, max_age_diff: Duration, ) -> Result<VerifiedSignatureHeader, SignatureError>
Verifies the signature using the specified public key.
The signature is considered valid if it can be verified using the given
public key and its embedded timestamp falls within the valid time range,
starting from start_time and not exceeding max_age.
Sourcepub fn as_signature_ref(&self) -> SignatureRef<'_>
pub fn as_signature_ref(&self) -> SignatureRef<'_>
Returns a borrowed view of the signature as a SignatureRef.
This method provides a lightweight reference wrapper over the internal signature data.
Trait Implementations§
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnsafeUnpin for Signature
impl UnwindSafe for Signature
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
Mutably borrows from an owned value. Read more