[−][src]Trait signatory::encoding::Decode
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
.
Provided methods
fn decode_from_str<S, E>(encoded_str: S, encoding: &E) -> Result<Self, Error> where
S: AsRef<str>,
E: Encoding,
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,
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,
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
.
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)