[−][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 signatory::ed25519::PublicKey
[src]
fn decode<E: Encoding>(encoded_key: &[u8], encoding: &E) -> Result<Self, Error>
[src]
Decode an Ed25519 seed from a byte slice with the given encoding (e.g. hex, Base64)
fn decode_from_str<S, E>(encoded_str: S, encoding: &E) -> Result<Self, Error> where
S: AsRef<str>,
E: Encoding,
[src]
S: AsRef<str>,
E: Encoding,
fn decode_from_reader<R, E>(reader: &mut R, encoding: &E) -> Result<Self, Error> where
R: Read,
E: Encoding,
[src]
R: Read,
E: Encoding,
fn decode_from_file<P, E>(path: P, encoding: &E) -> Result<Self, Error> where
P: AsRef<Path>,
E: Encoding,
[src]
P: AsRef<Path>,
E: Encoding,
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)
fn decode_from_str<S, E>(encoded_str: S, encoding: &E) -> Result<Self, Error> where
S: AsRef<str>,
E: Encoding,
[src]
S: AsRef<str>,
E: Encoding,
fn decode_from_reader<R, E>(reader: &mut R, encoding: &E) -> Result<Self, Error> where
R: Read,
E: Encoding,
[src]
R: Read,
E: Encoding,
fn decode_from_file<P, E>(path: P, encoding: &E) -> Result<Self, Error> where
P: AsRef<Path>,
E: Encoding,
[src]
P: AsRef<Path>,
E: Encoding,
impl Decode for Signature
[src]
fn decode<E: Encoding>(
encoded_signature: &[u8],
encoding: &E
) -> Result<Self, Error>
[src]
encoded_signature: &[u8],
encoding: &E
) -> Result<Self, Error>
Decode an Ed25519 signature from a byte slice with the given encoding (e.g. hex, Base64)
fn decode_from_str<S, E>(encoded_str: S, encoding: &E) -> Result<Self, Error> where
S: AsRef<str>,
E: Encoding,
[src]
S: AsRef<str>,
E: Encoding,
fn decode_from_reader<R, E>(reader: &mut R, encoding: &E) -> Result<Self, Error> where
R: Read,
E: Encoding,
[src]
R: Read,
E: Encoding,
fn decode_from_file<P, E>(path: P, encoding: &E) -> Result<Self, Error> where
P: AsRef<Path>,
E: Encoding,
[src]
P: AsRef<Path>,
E: Encoding,
impl<C> Decode for signatory::ecdsa::PublicKey<C> where
C: WeierstrassCurve,
[src]
C: WeierstrassCurve,
fn decode<E: Encoding>(
encoded_signature: &[u8],
encoding: &E
) -> Result<Self, Error>
[src]
encoded_signature: &[u8],
encoding: &E
) -> Result<Self, Error>
Decode an ECDSA public key from an elliptic curve point
(compressed or uncompressed) encoded using given Encoding
with the underlying bytes serialized using the
Elliptic-Curve-Point-to-Octet-String
algorithm described in
SEC 1: Elliptic Curve Cryptography (Version 2.0) section
2.3.3 (page 10).
fn decode_from_str<S, E>(encoded_str: S, encoding: &E) -> Result<Self, Error> where
S: AsRef<str>,
E: Encoding,
[src]
S: AsRef<str>,
E: Encoding,
fn decode_from_reader<R, E>(reader: &mut R, encoding: &E) -> Result<Self, Error> where
R: Read,
E: Encoding,
[src]
R: Read,
E: Encoding,
fn decode_from_file<P, E>(path: P, encoding: &E) -> Result<Self, Error> where
P: AsRef<Path>,
E: Encoding,
[src]
P: AsRef<Path>,
E: Encoding,
impl<C> Decode for Asn1Signature<C> where
C: WeierstrassCurve,
[src]
C: WeierstrassCurve,
fn decode<E: Encoding>(
encoded_signature: &[u8],
encoding: &E
) -> Result<Self, Error>
[src]
encoded_signature: &[u8],
encoding: &E
) -> Result<Self, Error>
Decode an ASN.1 encoded ECDSA signature from a byte slice with the given encoding (e.g. hex, Base64)
fn decode_from_str<S, E>(encoded_str: S, encoding: &E) -> Result<Self, Error> where
S: AsRef<str>,
E: Encoding,
[src]
S: AsRef<str>,
E: Encoding,
fn decode_from_reader<R, E>(reader: &mut R, encoding: &E) -> Result<Self, Error> where
R: Read,
E: Encoding,
[src]
R: Read,
E: Encoding,
fn decode_from_file<P, E>(path: P, encoding: &E) -> Result<Self, Error> where
P: AsRef<Path>,
E: Encoding,
[src]
P: AsRef<Path>,
E: Encoding,
impl<C> Decode for FixedSignature<C> where
C: WeierstrassCurve,
[src]
C: WeierstrassCurve,
fn decode<E: Encoding>(
encoded_signature: &[u8],
encoding: &E
) -> Result<Self, Error>
[src]
encoded_signature: &[u8],
encoding: &E
) -> Result<Self, Error>
Decode an ASN.1 encoded ECDSA signature from a byte slice with the given encoding (e.g. hex, Base64)
fn decode_from_str<S, E>(encoded_str: S, encoding: &E) -> Result<Self, Error> where
S: AsRef<str>,
E: Encoding,
[src]
S: AsRef<str>,
E: Encoding,
fn decode_from_reader<R, E>(reader: &mut R, encoding: &E) -> Result<Self, Error> where
R: Read,
E: Encoding,
[src]
R: Read,
E: Encoding,
fn decode_from_file<P, E>(path: P, encoding: &E) -> Result<Self, Error> where
P: AsRef<Path>,
E: Encoding,
[src]
P: AsRef<Path>,
E: Encoding,
impl<C> Decode for SecretKey<C> where
C: WeierstrassCurve,
[src]
C: WeierstrassCurve,
fn decode<E: Encoding>(encoded_key: &[u8], encoding: &E) -> Result<Self, Error>
[src]
Decode an Ed25519 seed from a byte slice with the given encoding (e.g. hex, Base64)
fn decode_from_str<S, E>(encoded_str: S, encoding: &E) -> Result<Self, Error> where
S: AsRef<str>,
E: Encoding,
[src]
S: AsRef<str>,
E: Encoding,
fn decode_from_reader<R, E>(reader: &mut R, encoding: &E) -> Result<Self, Error> where
R: Read,
E: Encoding,
[src]
R: Read,
E: Encoding,
fn decode_from_file<P, E>(path: P, encoding: &E) -> Result<Self, Error> where
P: AsRef<Path>,
E: Encoding,
[src]
P: AsRef<Path>,
E: Encoding,