[−][src]Trait signatory::encoding::Encode
Serialize keys/signatures with the given encoding (e.g. hex, Base64). Uses constant time encoder/decoder implementations.
Required methods
fn encode<E: Encoding>(&self, encoding: &E) -> Vec<u8>
Encode self
to a Vec<u8>
using the provided Encoding
, returning
the encoded value or a Error
.
Provided methods
fn encode_to_string<E: Encoding>(&self, encoding: &E) -> Result<String, Error>
Encode self
to a String
using the provided Encoding
, returning
the encoded value or a Error
.
fn encode_to_writer<W, E>(
&self,
writer: &mut W,
encoding: &E
) -> Result<usize, Error> where
W: Write,
E: Encoding,
&self,
writer: &mut W,
encoding: &E
) -> Result<usize, Error> where
W: Write,
E: Encoding,
Encode self
with the given Encoding
, writing the result to the
supplied io::Write
type, returning the number of bytes written or a Error
.
fn encode_to_file<P, E>(&self, path: P, encoding: &E) -> Result<File, Error> where
P: AsRef<Path>,
E: Encoding,
P: AsRef<Path>,
E: Encoding,
Encode self
and write it to a file at the given path, returning the
resulting File
or a Error
.
If the file does not exist, it will be created with a mode of
FILE_MODE
(i.e. 600
). If the file does exist, it will be erased
and replaced.
Implementors
impl Encode for PublicKey
[src]
fn encode<E: Encoding>(&self, encoding: &E) -> Vec<u8>
[src]
Encode an Ed25519 seed with the given encoding (e.g. hex, Base64)