pub trait EncodeKey: Sized {
// Required methods
fn to_key_der(&self) -> Result<Document>;
fn read_pem_file(path: impl AsRef<Path>) -> Result<Self>;
// Provided method
fn write_pem_file(
&self,
path: impl AsRef<Path>,
label: &'static str,
line_ending: LineEnding
) -> Result<()> { ... }
}Required Methods§
sourcefn to_key_der(&self) -> Result<Document>
fn to_key_der(&self) -> Result<Document>
Serialize a [Document] containing a ASN.1 DER-encoded key.
sourcefn read_pem_file(path: impl AsRef<Path>) -> Result<Self>
fn read_pem_file(path: impl AsRef<Path>) -> Result<Self>
Read key from given path
Provided Methods§
Object Safety§
This trait is not object safe.