pub struct PsaProvider<B> { /* private fields */ }Expand description
Adapts a concrete backend into a stable PSA provider API.
Implementations§
Source§impl<B> PsaProvider<B>
impl<B> PsaProvider<B>
Sourcepub fn new(backend: B) -> Self
pub fn new(backend: B) -> Self
Constructs a provider from a concrete backend implementation.
§Arguments
backend- Backend implementation used by provider operations.
§Returns
A new PsaProvider owning the backend.
Source§impl<B: PsaCryptoBackend> PsaProvider<B>
impl<B: PsaCryptoBackend> PsaProvider<B>
Sourcepub fn decrypt(&self, request: &KeyDecryptRequest<'_>) -> Result<Vec<u8>>
pub fn decrypt(&self, request: &KeyDecryptRequest<'_>) -> Result<Vec<u8>>
Dispatches decrypt requests with uniform decrypt failure posture.
§Arguments
self- Provider dispatching to backend.request- Decrypt request to execute.
§Returns
Plaintext bytes returned by backend.
§Errors
Returns Error::CryptoFailure for decrypt failures to avoid oracle leakage.
Sourcepub fn aes_gcm_encrypt(
&self,
request: &AeadEncryptRequest<'_>,
) -> Result<AeadEncryptResponse>
pub fn aes_gcm_encrypt( &self, request: &AeadEncryptRequest<'_>, ) -> Result<AeadEncryptResponse>
Trait Implementations§
Source§impl<B: Clone> Clone for PsaProvider<B>
impl<B: Clone> Clone for PsaProvider<B>
Source§fn clone(&self) -> PsaProvider<B>
fn clone(&self) -> PsaProvider<B>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<B> Freeze for PsaProvider<B>where
B: Freeze,
impl<B> RefUnwindSafe for PsaProvider<B>where
B: RefUnwindSafe,
impl<B> Send for PsaProvider<B>where
B: Send,
impl<B> Sync for PsaProvider<B>where
B: Sync,
impl<B> Unpin for PsaProvider<B>where
B: Unpin,
impl<B> UnsafeUnpin for PsaProvider<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for PsaProvider<B>where
B: UnwindSafe,
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