Trait ecdsa::SignatureEncoding
source · 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 { ... }
}
Expand description
Support for decoding/encoding signatures as bytes.
Required Associated Types§
Provided Methods§
sourcefn to_vec(&self) -> Vec<u8>
fn to_vec(&self) -> Vec<u8>
Available on crate feature
alloc
only.Encode signature as a byte vector.
sourcefn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Get the length of this signature when encoded.
Object Safety§
This trait is not object safe.
Implementors§
source§impl<C> SignatureEncoding for ecdsa::der::Signature<C>where
C: PrimeCurve,
MaxSize<C>: ArrayLength<u8>,
<FieldBytesSize<C> as Add>::Output: Add<MaxOverhead> + ArrayLength<u8>,
Available on crate features der
and alloc
only.
impl<C> SignatureEncoding for ecdsa::der::Signature<C>where C: PrimeCurve, MaxSize<C>: ArrayLength<u8>, <FieldBytesSize<C> as Add>::Output: Add<MaxOverhead> + ArrayLength<u8>,
Available on crate features
der
and alloc
only.source§impl<C> SignatureEncoding for ecdsa::Signature<C>where
C: PrimeCurve,
SignatureSize<C>: ArrayLength<u8>,
impl<C> SignatureEncoding for ecdsa::Signature<C>where C: PrimeCurve, SignatureSize<C>: ArrayLength<u8>,
source§impl<C> SignatureEncoding for SignatureWithOid<C>where
C: DigestPrimitive,
C::Digest: AssociatedOid,
SignatureSize<C>: ArrayLength<u8>,
Available on crate features digest
and hazmat
only.
impl<C> SignatureEncoding for SignatureWithOid<C>where C: DigestPrimitive, C::Digest: AssociatedOid, SignatureSize<C>: ArrayLength<u8>,
Available on crate features
digest
and hazmat
only.NOTE: this implementation assumes the default digest for the given elliptic
curve as defined by hazmat::DigestPrimitive
.
When working with alternative digests, you will need to use e.g.
SignatureWithOid::new_with_digest
.