pub trait KeyTransportBackend: Backend {
// Required methods
fn wrap(
&mut self,
key_id: &KeyId,
wrapping_key_id: &KeyId,
algorithm: WrapAlgorithm,
) -> Result<WrappedKey, BackendError>;
fn unwrap(
&mut self,
wrapped: &WrappedKey,
unwrapping_key_id: &KeyId,
label: &str,
) -> Result<KeyMetadata, BackendError>;
// Provided method
fn wrap_to_public(
&mut self,
key_id: &KeyId,
recipient_pub_key: &[u8],
algorithm: WrapAlgorithm,
) -> Result<WrappedKey, BackendError> { ... }
}Expand description
Key transport (wrapping) operations.
Required Methods§
Sourcefn wrap(
&mut self,
key_id: &KeyId,
wrapping_key_id: &KeyId,
algorithm: WrapAlgorithm,
) -> Result<WrappedKey, BackendError>
fn wrap( &mut self, key_id: &KeyId, wrapping_key_id: &KeyId, algorithm: WrapAlgorithm, ) -> Result<WrappedKey, BackendError>
Wrap key_id using wrapping_key_id with algorithm.
Sourcefn unwrap(
&mut self,
wrapped: &WrappedKey,
unwrapping_key_id: &KeyId,
label: &str,
) -> Result<KeyMetadata, BackendError>
fn unwrap( &mut self, wrapped: &WrappedKey, unwrapping_key_id: &KeyId, label: &str, ) -> Result<KeyMetadata, BackendError>
Unwrap wrapped using unwrapping_key_id, importing the result with label.
Provided Methods§
Sourcefn wrap_to_public(
&mut self,
key_id: &KeyId,
recipient_pub_key: &[u8],
algorithm: WrapAlgorithm,
) -> Result<WrappedKey, BackendError>
fn wrap_to_public( &mut self, key_id: &KeyId, recipient_pub_key: &[u8], algorithm: WrapAlgorithm, ) -> Result<WrappedKey, BackendError>
Wrap key_id to an external recipient’s raw public key.
Default implementation returns UnsupportedOperation.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".