pub struct FfiPsaBackend;Expand description
Implements the PSA backend trait for FFI-backed targets.
Implementations§
Source§impl FfiPsaBackend
impl FfiPsaBackend
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new FFI-backed backend adapter.
§Arguments
()- This constructor has no parameters.
§Returns
A default FfiPsaBackend instance.
Sourcepub fn has_ffi_shims(&self) -> bool
pub fn has_ffi_shims(&self) -> bool
Trait Implementations§
Source§impl Clone for FfiPsaBackend
impl Clone for FfiPsaBackend
Source§fn clone(&self) -> FfiPsaBackend
fn clone(&self) -> FfiPsaBackend
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FfiPsaBackend
impl Debug for FfiPsaBackend
Source§impl Default for FfiPsaBackend
impl Default for FfiPsaBackend
Source§fn default() -> FfiPsaBackend
fn default() -> FfiPsaBackend
Source§impl PsaCryptoBackend for FfiPsaBackend
impl PsaCryptoBackend for FfiPsaBackend
Source§fn sign(&self, request: &KeySignRequest<'_>) -> Result<Vec<u8>>
fn sign(&self, request: &KeySignRequest<'_>) -> Result<Vec<u8>>
Signs input digest bytes using a key handle and algorithm selected in request.
§Arguments
self- Backend instance receiving sign request dispatch.request- Sign request carrying key handle, algorithm, and digest bytes.
§Returns
Signature bytes if supported by this backend implementation.
§Errors
Returns Error::UnsupportedFeature until concrete FFI hooks are linked.
Source§fn decrypt(&self, request: &KeyDecryptRequest<'_>) -> Result<Vec<u8>>
fn decrypt(&self, request: &KeyDecryptRequest<'_>) -> Result<Vec<u8>>
Decrypts ciphertext bytes using a key handle and requested mechanism.
§Arguments
self- Backend instance receiving decrypt request dispatch.request- Decrypt request containing handle, algorithm, and ciphertext.
§Returns
Decrypted plaintext bytes if backend supports this operation.
§Errors
Returns Error::UnsupportedFeature until concrete FFI hooks are linked.
Source§fn derive(&self, request: &KeyDeriveRequest<'_>) -> Result<Vec<u8>>
fn derive(&self, request: &KeyDeriveRequest<'_>) -> Result<Vec<u8>>
Derives shared-secret bytes for a key handle and peer public key.
§Arguments
self- Backend instance receiving derive request dispatch.request- Derive request with handle, algorithm, and peer public bytes.
§Returns
Shared secret bytes derived by the configured algorithm.
§Errors
Returns Error::UnsupportedFeature until concrete FFI hooks are linked.
Source§fn random(&self, out: &mut [u8]) -> Result<()>
fn random(&self, out: &mut [u8]) -> Result<()>
Fills the output buffer with random bytes from PSA entropy source.
§Arguments
self- Backend instance receiving random generation request.out- Mutable byte slice to fill with random output.
§Returns
Ok(()) when random bytes were produced.
§Errors
Returns Error::UnsupportedFeature until concrete FFI hooks are linked.
Source§fn sha256(&self, input: &[u8]) -> Result<[u8; 32]>
fn sha256(&self, input: &[u8]) -> Result<[u8; 32]>
Computes SHA-256 digest for the input payload.
§Arguments
self- Backend instance receiving hash request dispatch.input- Bytes to hash with SHA-256.
§Returns
A 32-byte SHA-256 digest.
§Errors
Returns Error::UnsupportedFeature until concrete FFI hooks are linked.
Source§fn aes_gcm_encrypt(
&self,
request: &AeadEncryptRequest<'_>,
) -> Result<AeadEncryptResponse>
fn aes_gcm_encrypt( &self, request: &AeadEncryptRequest<'_>, ) -> Result<AeadEncryptResponse>
Encrypts plaintext bytes with AES-GCM and returns ciphertext plus tag.
§Arguments
self- Backend instance receiving AEAD encryption request.request- AES-GCM request with key, nonce, AAD, and plaintext.
§Returns
Ciphertext and 16-byte tag on successful encryption.
§Errors
Returns Error::UnsupportedFeature until concrete FFI hooks are linked.