Struct ring_compat::signature::ecdsa::der::Signature[][src]

pub struct Signature<C> where
    C: Curve + Order,
    <C as Curve>::FieldSize: Add<<C as Curve>::FieldSize>,
    <C as Curve>::FieldSize: ArrayLength<u8>,
    <C as Curve>::FieldSize: NonZero,
    <<<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArrayLength<u8>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: ArrayLength<u8>, 
{ /* fields omitted */ }
This is supported on crate feature signature only.

ASN.1 DER-encoded signature.

Generic over the scalar size of the elliptic curve.

Implementations

impl<C> Signature<C> where
    C: Curve + Order,
    <C as Curve>::FieldSize: Add<<C as Curve>::FieldSize>,
    <C as Curve>::FieldSize: ArrayLength<u8>,
    <C as Curve>::FieldSize: NonZero,
    <<<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArrayLength<u8>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: ArrayLength<u8>, 
[src]

pub fn len(&self) -> usize[src]

Get the length of the signature in bytes

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

Borrow this signature as a byte slice

pub fn to_bytes(&self) -> Box<[u8], Global>[src]

Serialize this signature as a boxed byte slice

Trait Implementations

impl<C> AsRef<[u8]> for Signature<C> where
    C: Curve + Order,
    <C as Curve>::FieldSize: Add<<C as Curve>::FieldSize>,
    <C as Curve>::FieldSize: ArrayLength<u8>,
    <C as Curve>::FieldSize: NonZero,
    <<<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArrayLength<u8>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: ArrayLength<u8>, 
[src]

impl<C> Debug for Signature<C> where
    C: Curve + Order,
    <C as Curve>::FieldSize: Add<<C as Curve>::FieldSize>,
    <C as Curve>::FieldSize: ArrayLength<u8>,
    <C as Curve>::FieldSize: NonZero,
    <<<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArrayLength<u8>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: ArrayLength<u8>, 
[src]

impl<C> Signature for Signature<C> where
    C: Curve + Order,
    <C as Curve>::FieldSize: Add<<C as Curve>::FieldSize>,
    <C as Curve>::FieldSize: ArrayLength<u8>,
    <C as Curve>::FieldSize: NonZero,
    <<<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArrayLength<u8>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: ArrayLength<u8>, 
[src]

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

Parse an ASN.1 DER-encoded ECDSA signature from a byte slice

impl<'_, C> TryFrom<&'_ [u8]> for Signature<C> where
    C: Curve + Order,
    <C as Curve>::FieldSize: Add<<C as Curve>::FieldSize>,
    <C as Curve>::FieldSize: ArrayLength<u8>,
    <C as Curve>::FieldSize: NonZero,
    <<<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArrayLength<u8>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: ArrayLength<u8>, 
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<C> TryFrom<Signature<C>> for Signature<C> where
    C: Curve + Order,
    <C as Curve>::FieldSize: Add<<C as Curve>::FieldSize>,
    <C as Curve>::FieldSize: ArrayLength<u8>,
    <C as Curve>::FieldSize: NonZero,
    <<<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArrayLength<u8>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: ArrayLength<u8>, 
[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<C> RefUnwindSafe for Signature<C> where
    <<<<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output as ArrayLength<u8>>::ArrayType: RefUnwindSafe

impl<C> Send for Signature<C>

impl<C> Sync for Signature<C>

impl<C> Unpin for Signature<C> where
    <<<<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output as ArrayLength<u8>>::ArrayType: Unpin

impl<C> UnwindSafe for Signature<C> where
    <<<<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output as ArrayLength<u8>>::ArrayType: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.