Trait sm9::EncodeKey

source ·
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§

source

fn to_key_der(&self) -> Result<Document>

Serialize a [Document] containing a ASN.1 DER-encoded key.

source

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

Read key from given path

Provided Methods§

source

fn write_pem_file( &self, path: impl AsRef<Path>, label: &'static str, line_ending: LineEnding ) -> Result<()>

Write ASN.1 DER-encoded key to the given path

Object Safety§

This trait is not object safe.

Implementors§