pub struct RotatingVerifier { /* private fields */ }Expand description
Tries multiple verifiers until one succeeds.
Implementations§
Source§impl RotatingVerifier
impl RotatingVerifier
Sourcepub fn new(verifiers: Vec<MessageVerifier>) -> Self
pub fn new(verifiers: Vec<MessageVerifier>) -> Self
Creates a rotating verifier with the newest verifier first.
Sourcepub fn generate(&self, data: &[u8]) -> String
pub fn generate(&self, data: &[u8]) -> String
Generates a signed message using the newest verifier.
Sourcepub fn generate_with_purpose(
&self,
data: &[u8],
purpose: &str,
expires_at: Option<DateTime<Utc>>,
) -> String
pub fn generate_with_purpose( &self, data: &[u8], purpose: &str, expires_at: Option<DateTime<Utc>>, ) -> String
Generates a signed message with purpose using the newest verifier.
Sourcepub fn verify(&self, signed_message: &str) -> Result<Vec<u8>, VerifierError>
pub fn verify(&self, signed_message: &str) -> Result<Vec<u8>, VerifierError>
Verifies a signed message with all configured verifiers.
Sourcepub fn verify_with_purpose(
&self,
signed_message: &str,
purpose: &str,
) -> Result<Vec<u8>, VerifierError>
pub fn verify_with_purpose( &self, signed_message: &str, purpose: &str, ) -> Result<Vec<u8>, VerifierError>
Verifies a signed message with purpose using all configured verifiers.
Sourcepub fn valid_message(&self, signed_message: &str) -> bool
pub fn valid_message(&self, signed_message: &str) -> bool
Returns true when any configured verifier accepts the message.
Auto Trait Implementations§
impl Freeze for RotatingVerifier
impl RefUnwindSafe for RotatingVerifier
impl Send for RotatingVerifier
impl Sync for RotatingVerifier
impl Unpin for RotatingVerifier
impl UnsafeUnpin for RotatingVerifier
impl UnwindSafe for RotatingVerifier
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
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>
Converts
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>
Converts
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