pub trait PemSerilizable: ToWriter + FromReader {
    // Required method
    fn label() -> &'static str;

    // Provided methods
    fn write_pem_file(&self, path: &Path) -> Result<()> { ... }
    fn read_pem_file(path: &Path) -> Result<Self> { ... }
}
Expand description

Trait for data that can be written to and read from PEM files.

Required Methods§

source

fn label() -> &'static str

The label for the PEM file.

Appears around the base64 encoded data. —–BEGIN MY_LABEL—– … —–END MY_LABEL—–

Provided Methods§

source

fn write_pem_file(&self, path: &Path) -> Result<()>

Write to PEM file with label from Self::label().

source

fn read_pem_file(path: &Path) -> Result<Self>

Read in from PEM file, ensuring the label matches Self::label().

Implementors§