Struct signatory::ecdsa::FixedSignature [−][src]
pub struct FixedSignature<C: WeierstrassCurve> { /* fields omitted */ }
ECDSA signatures serialized in a compact, fixed-sized form
Methods
impl<C> FixedSignature<C> where
C: WeierstrassCurve,
[src]
impl<C> FixedSignature<C> where
C: WeierstrassCurve,
pub fn into_bytes(self) -> GenericArray<u8, C::FixedSignatureSize>
[src]
pub fn into_bytes(self) -> GenericArray<u8, C::FixedSignatureSize>
Convert signature into owned byte array
Trait Implementations
impl<'s, C> From<&'s FixedSignature<C>> for Asn1Signature<C> where
C: WeierstrassCurve,
[src]
impl<'s, C> From<&'s FixedSignature<C>> for Asn1Signature<C> where
C: WeierstrassCurve,
fn from(fixed_signature: &FixedSignature<C>) -> Self
[src]
fn from(fixed_signature: &FixedSignature<C>) -> Self
Parse r
and s
values from a fixed-width signature and reserialize
them as ASN.1 DER.
impl<'s, C> From<&'s Asn1Signature<C>> for FixedSignature<C> where
C: WeierstrassCurve,
[src]
impl<'s, C> From<&'s Asn1Signature<C>> for FixedSignature<C> where
C: WeierstrassCurve,
fn from(asn1_signature: &Asn1Signature<C>) -> FixedSignature<C>
[src]
fn from(asn1_signature: &Asn1Signature<C>) -> FixedSignature<C>
Performs the conversion.
impl<C: Clone + WeierstrassCurve> Clone for FixedSignature<C> where
C::FixedSignatureSize: Clone,
[src]
impl<C: Clone + WeierstrassCurve> Clone for FixedSignature<C> where
C::FixedSignatureSize: Clone,
fn clone(&self) -> FixedSignature<C>
[src]
fn clone(&self) -> FixedSignature<C>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<C: PartialEq + WeierstrassCurve> PartialEq for FixedSignature<C> where
C::FixedSignatureSize: PartialEq,
[src]
impl<C: PartialEq + WeierstrassCurve> PartialEq for FixedSignature<C> where
C::FixedSignatureSize: PartialEq,
fn eq(&self, other: &FixedSignature<C>) -> bool
[src]
fn eq(&self, other: &FixedSignature<C>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &FixedSignature<C>) -> bool
[src]
fn ne(&self, other: &FixedSignature<C>) -> bool
This method tests for !=
.
impl<C: Eq + WeierstrassCurve> Eq for FixedSignature<C> where
C::FixedSignatureSize: Eq,
[src]
impl<C: Eq + WeierstrassCurve> Eq for FixedSignature<C> where
C::FixedSignatureSize: Eq,
impl<C> Signature for FixedSignature<C> where
C: WeierstrassCurve,
[src]
impl<C> Signature for FixedSignature<C> where
C: WeierstrassCurve,
fn from_bytes<B: AsRef<[u8]>>(bytes: B) -> Result<Self, Error>
[src]
fn from_bytes<B: AsRef<[u8]>>(bytes: B) -> Result<Self, Error>
Create an ECDSA signature from its serialized byte representation
fn as_slice(&self) -> &[u8]
[src]
fn as_slice(&self) -> &[u8]
Borrow a signature as a byte slice
fn into_vec(self) -> Vec<u8>
[src]
fn into_vec(self) -> Vec<u8>
Convert signature into owned byte array
impl<C: WeierstrassCurve> Signature for FixedSignature<C>
[src]
impl<C: WeierstrassCurve> Signature for FixedSignature<C>
impl<C> AsRef<[u8]> for FixedSignature<C> where
C: WeierstrassCurve,
[src]
impl<C> AsRef<[u8]> for FixedSignature<C> where
C: WeierstrassCurve,
impl<C> Debug for FixedSignature<C> where
C: WeierstrassCurve,
[src]
impl<C> Debug for FixedSignature<C> where
C: WeierstrassCurve,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<C> Decode for FixedSignature<C> where
C: WeierstrassCurve,
[src]
impl<C> Decode for FixedSignature<C> where
C: WeierstrassCurve,
fn decode<E: Encoding>(
encoded_signature: &[u8],
encoding: &E
) -> Result<Self, Error>
[src]
fn decode<E: Encoding>(
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]
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
. Read more
fn decode_from_reader<R, E>(reader: &mut R, encoding: &E) -> Result<Self, Error> where
R: Read,
E: Encoding,
[src]
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
. Read more
fn decode_from_file<P, E>(path: P, encoding: &E) -> Result<Self, Error> where
P: AsRef<Path>,
E: Encoding,
[src]
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
. Read more
impl<C> Encode for FixedSignature<C> where
C: WeierstrassCurve,
[src]
impl<C> Encode for FixedSignature<C> where
C: WeierstrassCurve,
fn encode<E: Encoding>(&self, encoding: &E) -> Vec<u8>
[src]
fn encode<E: Encoding>(&self, encoding: &E) -> Vec<u8>
Encode an ASN.1 encoded ECDSA signature with the given encoding (e.g. hex, Base64)
fn encode_to_string<E: Encoding>(&self, encoding: &E) -> Result<String, Error>
[src]
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
. Read more
fn encode_to_writer<W, E>(
&self,
writer: &mut W,
encoding: &E
) -> Result<usize, Error> where
W: Write,
E: Encoding,
[src]
fn encode_to_writer<W, E>(
&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
. Read more
fn encode_to_file<P, E>(&self, path: P, encoding: &E) -> Result<File, Error> where
P: AsRef<Path>,
E: Encoding,
[src]
fn encode_to_file<P, E>(&self, path: P, encoding: &E) -> Result<File, Error> where
P: AsRef<Path>,
E: Encoding,
Encode self
and write it to a file at the given path, returning the resulting File
or a Error
. Read more
impl<C> From<GenericArray<u8, C::FixedSignatureSize>> for FixedSignature<C> where
C: WeierstrassCurve,
[src]
impl<C> From<GenericArray<u8, C::FixedSignatureSize>> for FixedSignature<C> where
C: WeierstrassCurve,
fn from(bytes: GenericArray<u8, C::FixedSignatureSize>) -> Self
[src]
fn from(bytes: GenericArray<u8, C::FixedSignatureSize>) -> Self
Performs the conversion.
Auto Trait Implementations
impl<C> Send for FixedSignature<C> where
<<C as WeierstrassCurve>::FixedSignatureSize as ArrayLength<u8>>::ArrayType: Send,
impl<C> Send for FixedSignature<C> where
<<C as WeierstrassCurve>::FixedSignatureSize as ArrayLength<u8>>::ArrayType: Send,
impl<C> Sync for FixedSignature<C> where
<<C as WeierstrassCurve>::FixedSignatureSize as ArrayLength<u8>>::ArrayType: Sync,
impl<C> Sync for FixedSignature<C> where
<<C as WeierstrassCurve>::FixedSignatureSize as ArrayLength<u8>>::ArrayType: Sync,