pub trait Backend:
Send
+ Sync
+ Debug {
// Required methods
fn reference(&self) -> WrapRef;
fn wrap(&self, ctx: WrapContext, key: &Key) -> Result<Vec<u8>, WrapError>;
fn unwrap(&self, ctx: WrapContext, blob: &Blob) -> Result<Key, WrapError>;
}Expand description
A key backend: a service or a device that holds a key which never leaves it, and wraps and unwraps keys under that key. Its methods are synchronous: the registry calls them from blocking threads.
Required Methods§
Sourcefn unwrap(&self, ctx: WrapContext, blob: &Blob) -> Result<Key, WrapError>
fn unwrap(&self, ctx: WrapContext, blob: &Blob) -> Result<Key, WrapError>
Unwraps the ciphertext of blob, made for ctx, into a locked page
of its own.
§Errors
WrapError::Damaged when the ciphertext does not open for ctx,
and any other WrapError when the backend does not unwrap it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".