pub trait EncodableKey: Sized {
    // Required methods
    fn read<R: Read>(reader: &mut R) -> Result<Self, Box<dyn Error>>;
    fn write<W: Write>(&self, writer: &mut W) -> Result<String, Box<dyn Error>>;
    fn from_seed(seed: &[u8]) -> Result<Self, Box<dyn Error>>;
    fn from_seed_and_derivation_path(
        seed: &[u8],
        derivation_path: Option<DerivationPath>
    ) -> Result<Self, Box<dyn Error>>;
    fn from_seed_phrase_and_passphrase(
        seed_phrase: &str,
        passphrase: &str
    ) -> Result<Self, Box<dyn Error>>;

    // Provided methods
    fn read_from_file<F: AsRef<Path>>(path: F) -> Result<Self, Box<dyn Error>> { ... }
    fn write_to_file<F: AsRef<Path>>(
        &self,
        outfile: F
    ) -> Result<String, Box<dyn Error>> { ... }
}
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: Read>(reader: &mut R) -> Result<Self, Box<dyn Error>>

source

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

source

fn from_seed(seed: &[u8]) -> Result<Self, Box<dyn Error>>

source

fn from_seed_and_derivation_path( seed: &[u8], derivation_path: Option<DerivationPath> ) -> Result<Self, Box<dyn Error>>

source

fn from_seed_phrase_and_passphrase( seed_phrase: &str, passphrase: &str ) -> Result<Self, Box<dyn Error>>

Provided Methods§

source

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

source

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

Implementors§