Skip to main content

ExportableKeyBackend

Trait ExportableKeyBackend 

Source
pub trait ExportableKeyBackend: KeyBackend {
    // Required method
    fn export_key_dangerous(
        &self,
        h: &KeyHandle,
    ) -> Result<ExportedKey, BackendError>;
}
Expand description

OPTIONAL. Plaintext export of a key the backend holds. A software backend (RustCrypto) implements this; an HSM/PKCS#11 backend does NOT — so “keys never leave the token” is enforced by the type system, not a runtime error.

Required Methods§

Source

fn export_key_dangerous( &self, h: &KeyHandle, ) -> Result<ExportedKey, BackendError>

Export the plaintext bytes of the key referenced by h (software backends only).

§Errors

Returns BackendError::Crypto if h does not refer to a live, exportable key, or BackendError::Unsupported if export is refused.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§