[][src]Trait signatory::encoding::Decode

pub trait Decode: Sized {
    fn decode<E: Encoding>(encoded: &[u8], encoding: &E) -> Result<Self, Error>;

    fn decode_from_str<S, E>(
        encoded_str: S,
        encoding: &E
    ) -> Result<Self, Error>
    where
        S: AsRef<str>,
        E: Encoding
, { ... }
fn decode_from_reader<R, E>(
        reader: &mut R,
        encoding: &E
    ) -> Result<Self, Error>
    where
        R: Read,
        E: Encoding
, { ... }
fn decode_from_file<P, E>(path: P, encoding: &E) -> Result<Self, Error>
    where
        P: AsRef<Path>,
        E: Encoding
, { ... } }

Decode keys/signatures from encoded data (e.g. hex, Base64). Uses constant time encoder/decoder implementations.

Required methods

fn decode<E: Encoding>(encoded: &[u8], encoding: &E) -> Result<Self, Error>

Decode the given byte slice using the provided Encoding, returning the decoded value or a Error.

Loading content...

Provided methods

fn decode_from_str<S, E>(encoded_str: S, encoding: &E) -> Result<Self, Error> where
    S: AsRef<str>,
    E: Encoding

Decode the given string-alike type with the provided Encoding, returning the decoded value or a Error.

fn decode_from_reader<R, E>(reader: &mut R, encoding: &E) -> Result<Self, Error> where
    R: Read,
    E: Encoding

Decode the data read from the given io::Read type with the provided Encoding, returning the decoded value or a Error.

fn decode_from_file<P, E>(path: P, encoding: &E) -> Result<Self, Error> where
    P: AsRef<Path>,
    E: Encoding

Read a file at the given path, decoding the data it contains using the provided Encoding, returning the decoded value or a Error.

Loading content...

Implementors

impl Decode for PublicKey[src]

fn decode<E: Encoding>(encoded_key: &[u8], encoding: &E) -> Result<Self, Error>[src]

Decode an Ed25519 public key from a byte slice with the given encoding (e.g. hex, Base64)

impl Decode for Seed[src]

fn decode<E: Encoding>(encoded_seed: &[u8], encoding: &E) -> Result<Self, Error>[src]

Decode an Ed25519 seed from a byte slice with the given encoding (e.g. hex, Base64)

Loading content...