pub struct Signature(pub String);
Expand description
A wrapper around a String that represents a signature.
Tuple Fields§
§0: String
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn verify_any(
&self,
public_key: &[PublicKey],
start_time: DateTime<Utc>,
max_age: Duration,
) -> bool
pub fn verify_any( &self, public_key: &[PublicKey], start_time: DateTime<Utc>, max_age: Duration, ) -> bool
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,
public_key: &PublicKey,
start_time: DateTime<Utc>,
max_age: Duration,
) -> bool
pub fn verify( &self, public_key: &PublicKey, start_time: DateTime<Utc>, max_age: Duration, ) -> bool
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 verify_bytes(&self, data: &[u8], public_key: &PublicKey) -> bool
pub fn verify_bytes(&self, data: &[u8], public_key: &PublicKey) -> bool
Verifies the signature against the given data and public key.
Returns true
if the signature is valid for the provided data
when verified with the given public key.
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.