Trait opentitanlib::util::file::PemSerilizable
source · 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§
Provided Methods§
sourcefn write_pem_file(&self, path: &Path) -> Result<()>
fn write_pem_file(&self, path: &Path) -> Result<()>
Write to PEM file with label from Self::label()
.
sourcefn read_pem_file(path: &Path) -> Result<Self>
fn read_pem_file(path: &Path) -> Result<Self>
Read in from PEM file, ensuring the label matches Self::label()
.