Type Alias DerSignature

Source
pub type DerSignature = Signature<NistP256>;
Expand description

ECDSA/P-256 signature (ASN.1 DER encoded)

Aliased Type§

struct DerSignature { /* private fields */ }

Implementations

Source§

impl<C> Signature<C>

Source

pub fn from_bytes(input: &[u8]) -> Result<Signature<C>, Error>

Parse signature from DER-encoded bytes.

Source

pub fn as_bytes(&self) -> &[u8]

Borrow this signature as a byte slice

Source

pub fn len(&self) -> usize

Get the length of the signature in bytes

Trait Implementations

Source§

impl<C> AsRef<[u8]> for Signature<C>

Source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<C> Clone for Signature<C>

Source§

fn clone(&self) -> Signature<C>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C> Debug for Signature<C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a, C> Decode<'a> for Signature<C>

Source§

fn decode<R>(reader: &mut R) -> Result<Signature<C>, Error>
where R: Reader<'a>,

Attempt to decode this message using the provided decoder.
Source§

fn from_der(bytes: &'a [u8]) -> Result<Self, Error>

Parse Self from the provided DER-encoded byte slice.
Source§

impl<C> Encode for Signature<C>

Source§

fn encoded_len(&self) -> Result<Length, Error>

Compute the length of this value in bytes when encoded as ASN.1 DER.
Source§

fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>

Encode this value as ASN.1 DER using the provided Writer.
Source§

fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>

Encode this value to the provided byte slice, returning a sub-slice containing the encoded message.
Source§

impl<C> FixedTag for Signature<C>

Source§

const TAG: Tag = Tag::Sequence

ASN.1 tag
Source§

impl<C> From<Signature<C>> for Signature<C>

Source§

fn from(sig: Signature<C>) -> Signature<C>

Converts to this type from the input type.
Source§

impl<C> PrehashSignature for Signature<C>

Source§

type Digest = <C as DigestPrimitive>::Digest

Preferred Digest algorithm to use when computing this signature type.
Source§

impl<C> TryFrom<&[u8]> for Signature<C>

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(input: &[u8]) -> Result<Signature<C>, Error>

Performs the conversion.