Skip to main content

KeyTransportBackend

Trait KeyTransportBackend 

Source
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§

Source

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.

Source

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§

Source

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.

Implementors§