Trait EncodableKey

Source
pub trait EncodableKey: Sized {
    // Required methods
    fn read<R>(reader: &mut R) -> Result<Self, Box<dyn Error>>
       where R: Read;
    fn write<W>(&self, writer: &mut W) -> Result<String, Box<dyn Error>>
       where W: Write;

    // Provided methods
    fn read_from_file<F>(path: F) -> Result<Self, Box<dyn Error>>
       where F: AsRef<Path> { ... }
    fn write_to_file<F>(&self, outfile: F) -> Result<String, Box<dyn Error>>
       where F: AsRef<Path> { ... }
}
Available on crate feature full only.
Expand description

The EncodableKey trait defines the interface by which cryptographic keys/keypairs are read, written, and derived from sources.

Required Methods§

Source

fn read<R>(reader: &mut R) -> Result<Self, Box<dyn Error>>
where R: Read,

Source

fn write<W>(&self, writer: &mut W) -> Result<String, Box<dyn Error>>
where W: Write,

Provided Methods§

Source

fn read_from_file<F>(path: F) -> Result<Self, Box<dyn Error>>
where F: AsRef<Path>,

Source

fn write_to_file<F>(&self, outfile: F) -> Result<String, Box<dyn Error>>
where F: AsRef<Path>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§