Skip to main content

KeyParser

Trait KeyParser 

Source
pub trait KeyParser: WithMulticodec {
    // Required method
    fn parse(
        &self,
        public_key: Vec<u8>,
    ) -> Result<Box<dyn PublicKey>, ParseError>;
}

Required Methods§

Source

fn parse(&self, public_key: Vec<u8>) -> Result<Box<dyn PublicKey>, ParseError>

Parse a public key from raw bytes.

§Errors

Returns an error if the bytes do not represent a valid public key.

Implementors§