pub trait DeviceKeystore: Send + Sync {
// Required methods
fn seal(
&self,
associated_data: Vec<u8>,
plaintext: Vec<u8>,
) -> StorageResult<Vec<u8>>;
fn open_sealed(
&self,
associated_data: Vec<u8>,
ciphertext: Vec<u8>,
) -> StorageResult<Vec<u8>>;
}Expand description
Device keystore interface used to seal and open account keys.
Required Methods§
Sourcefn seal(
&self,
associated_data: Vec<u8>,
plaintext: Vec<u8>,
) -> StorageResult<Vec<u8>>
fn seal( &self, associated_data: Vec<u8>, plaintext: Vec<u8>, ) -> StorageResult<Vec<u8>>
Seals plaintext under the device-bound key, authenticating associated_data.
The associated data is not encrypted, but it is integrity-protected as part of the seal operation. Any mismatch when opening must fail.
§Errors
Returns an error if the keystore refuses the operation or the seal fails.
Sourcefn open_sealed(
&self,
associated_data: Vec<u8>,
ciphertext: Vec<u8>,
) -> StorageResult<Vec<u8>>
fn open_sealed( &self, associated_data: Vec<u8>, ciphertext: Vec<u8>, ) -> StorageResult<Vec<u8>>
Opens ciphertext under the device-bound key, verifying associated_data.
The same associated data used during sealing must be supplied or the open operation must fail.
§Errors
Returns an error if authentication fails or the keystore cannot open.
Trait Implementations§
Source§impl<T> FfiConverterArc<T> for dyn DeviceKeystore
impl<T> FfiConverterArc<T> for dyn DeviceKeystore
Source§impl<T> LiftRef<T> for dyn DeviceKeystore
impl<T> LiftRef<T> for dyn DeviceKeystore
type LiftType = Arc<dyn DeviceKeystore>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".