pub trait SignatureEncoding: Clone + Sized + for<'a> TryFrom<&'a [u8]> + TryInto<Self::Repr> {
    type Repr: 'static + AsRef<[u8]> + Clone + Send + Sync;

    // Provided methods
    fn to_bytes(&self) -> Self::Repr { ... }
    fn to_vec(&self) -> Vec<u8> { ... }
    fn encoded_len(&self) -> usize { ... }
}
Available on crate feature signature only.
Expand description

Support for decoding/encoding signatures as bytes.

Required Associated Types§

source

type Repr: 'static + AsRef<[u8]> + Clone + Send + Sync

Byte representation of a signature.

Provided Methods§

source

fn to_bytes(&self) -> Self::Repr

Encode signature as its byte representation.

source

fn to_vec(&self) -> Vec<u8>

Available on crate feature alloc only.

Encode signature as a byte vector.

source

fn encoded_len(&self) -> usize

Get the length of this signature when encoded.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl SignatureEncoding for ring_compat::signature::ed25519::Signature

§

type Repr = [u8; 64]

source§

impl<C> SignatureEncoding for ring_compat::signature::ecdsa::der::Signature<C>where C: PrimeCurve, <<<C as Curve>::FieldBytesSize as Add>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArrayLength<u8>, <<C as Curve>::FieldBytesSize as Add>::Output: Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>> + ArrayLength<u8>,

Available on crate feature alloc only.
§

type Repr = Box<[u8]>

source§

impl<C> SignatureEncoding for ring_compat::signature::ecdsa::Signature<C>where C: PrimeCurve, <<C as Curve>::FieldBytesSize as Add>::Output: ArrayLength<u8>,

§

type Repr = GenericArray<u8, <<C as Curve>::FieldBytesSize as Add>::Output>