pub struct KmsClient { /* private fields */ }Expand description
KMS client for Webex end-to-end encryption.
Implementations§
Source§impl KmsClient
impl KmsClient
pub fn new( http_do: FetchFn, token: &str, device_url: &str, user_id: &str, encryption_service_url: &str, ) -> Self
Sourcepub fn response_handler(&self) -> KmsResponseHandler
pub fn response_handler(&self) -> KmsResponseHandler
Get a KmsResponseHandler that can resolve pending requests from Mercury.
The returned handler can be used without holding the KmsClient lock, preventing deadlocks during initialize() and get_key().
Sourcepub async fn initialize(&mut self) -> Result<(), WebexError>
pub async fn initialize(&mut self) -> Result<(), WebexError>
Initialize KMS context with ECDH handshake.
Sourcepub async fn get_key(&mut self, key_uri: &str) -> Result<[u8; 32], WebexError>
pub async fn get_key(&mut self, key_uri: &str) -> Result<[u8; 32], WebexError>
Retrieve an encryption key from KMS.
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Whether the KMS client has been initialized.
Auto Trait Implementations§
impl Freeze for KmsClient
impl !RefUnwindSafe for KmsClient
impl Send for KmsClient
impl Sync for KmsClient
impl Unpin for KmsClient
impl UnsafeUnpin for KmsClient
impl !UnwindSafe for KmsClient
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