Skip to main content

KeyInfoManagerClient

Struct KeyInfoManagerClient 

Source
pub struct KeyInfoManagerClient { /* private fields */ }
Expand description

KeyInfoManager client structure that bridges between the KIM and the providers that need to use it.

Implementations§

Source§

impl KeyInfoManagerClient

Source

pub fn get_key_identity( &self, application: ApplicationIdentity, key_name: String, ) -> KeyIdentity

Get the KeyIdentity representing a key.

Source

pub fn get_key_id<T: DeserializeOwned>( &self, key_identity: &KeyIdentity, ) -> Result<T>

Get the key ID for a given KeyIdentity

The ID does not have to be a specific type. Rather, it must implement the serde::Deserialize trait. Before returning, an instance of that type is created from the bytes stored by the KIM.

§Errors

If the key does not exist, PsaErrorDoesNotExist is returned. If any error occurs while fetching the key info, KeyInfoManagerError is returned. If deserializing the stored key ID to the desired type fails, InvalidEncoding is returned.

Source

pub fn get_key_attributes( &self, key_identity: &KeyIdentity, ) -> Result<Attributes>

Get the Attributes for a given KeyIdentity

§Errors

If the key does not exist, PsaErrorDoesNotExist is returned. If any other error occurs, KeyInfoManagerError is returned.

Source

pub fn get_all(&self) -> Result<Vec<KeyIdentity>>

Get all the key identities for the current provider

Source

pub fn remove_key_info(&self, key_identity: &KeyIdentity) -> Result<()>

Remove the key represented by a KeyIdentity and return the stored info.

§Errors

If the key does not exist, PsaErrorDoesNotExist is returned. If any other error occurs, KeyInfoManagerError is returned.

Source

pub fn insert_key_info<T: Serialize>( &self, key_identity: KeyIdentity, key_id: &T, attributes: Attributes, ) -> Result<()>

Insert key info for a given KeyIdentity.

§Errors

If the KeyIdentity already existed in the KIM, PsaErrorAlreadyExists is returned. For any other error occurring in the KIM, KeyInfoManagerError is returned.

Source

pub fn replace_key_info<T: Serialize>( &self, key_identity: KeyIdentity, key_id: &T, attributes: Attributes, ) -> Result<()>

Replace the KeyInfo saved for a given KeyIdentity

§Errors

If the key identity doesn’t exist in the KIM, PsaErrorDoesNotExist is returned. For any other error occurring in the KIM, KeyInfoManagerError is returned.

Source

pub fn list_clients(&self) -> Result<Vec<ApplicationIdentity>>

Returns a Vec of clients that have keys in this provider.

§Errors

Returns an error as a String if there was a problem accessing the Key Info Manager.

Source

pub fn list_keys( &self, application_identity: &ApplicationIdentity, ) -> Result<Vec<KeyInfo>>

Returns a Vec of the KeyInfo objects corresponding to the given ApplicationIdentity, and the KIM client ProviderIdentity.

§Errors

Returns an error as a String if there was a problem accessing the Key Info Manager.

Source

pub fn does_not_exist( &self, key_identity: &KeyIdentity, ) -> Result<(), ResponseStatus>

Check if a KeyIdentity exists in the Key Info Manager and return a ResponseStatus

§Errors

Returns PsaErrorAlreadyExists if the KeyIdentity already exists or KeyInfoManagerError for another error.

Trait Implementations§

Source§

impl Debug for KeyInfoManagerClient

Source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Free for T

Source§

unsafe fn free(ptr_ref: NonNull<T>)

Drops the content pointed by this pointer and frees it. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V