pub struct MessageVerifier { /* private fields */ }Expand description
Message verifier for server-side use with optional persistence
Implementations§
Source§impl MessageVerifier
impl MessageVerifier
Sourcepub async fn new_with_persistence(
max_timestamp_drift: i64,
db_ops: Arc<DbOperationsV2>,
) -> SecurityResult<Self>
pub async fn new_with_persistence( max_timestamp_drift: i64, db_ops: Arc<DbOperationsV2>, ) -> SecurityResult<Self>
Create a new message verifier with database persistence
Sourcepub async fn register_system_public_key(
&self,
key_info: PublicKeyInfo,
) -> SecurityResult<()>
pub async fn register_system_public_key( &self, key_info: PublicKeyInfo, ) -> SecurityResult<()>
Register the system-wide public key with automatic persistence
Sourcepub async fn remove_system_public_key(&self) -> SecurityResult<()>
pub async fn remove_system_public_key(&self) -> SecurityResult<()>
Remove the system public key from both memory and database
Sourcepub fn get_system_public_key(&self) -> SecurityResult<Option<PublicKeyInfo>>
pub fn get_system_public_key(&self) -> SecurityResult<Option<PublicKeyInfo>>
Get the system public key info
Sourcepub fn list_public_keys(&self) -> SecurityResult<Vec<PublicKeyInfo>>
pub fn list_public_keys(&self) -> SecurityResult<Vec<PublicKeyInfo>>
List the system public key if it exists.
Sourcepub fn verify_message(
&self,
signed_message: &SignedMessage,
) -> SecurityResult<VerificationResult>
pub fn verify_message( &self, signed_message: &SignedMessage, ) -> SecurityResult<VerificationResult>
Verify a signed message
Sourcepub fn verify_message_with_permissions(
&self,
signed_message: &SignedMessage,
required_permissions: &[String],
) -> SecurityResult<VerificationResult>
pub fn verify_message_with_permissions( &self, signed_message: &SignedMessage, required_permissions: &[String], ) -> SecurityResult<VerificationResult>
Check permissions and verify message
Auto Trait Implementations§
impl Freeze for MessageVerifier
impl !RefUnwindSafe for MessageVerifier
impl Send for MessageVerifier
impl Sync for MessageVerifier
impl Unpin for MessageVerifier
impl !UnwindSafe for MessageVerifier
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 moreCreates a shared type from an unshared type.