Struct der::BigUInt[][src]

pub struct BigUInt<'a, N: BigUIntSize> { /* fields omitted */ }
This is supported on crate feature big-uint only.

"Big" unsigned ASN.1 INTEGER type.

Provides direct access to the underlying big endian bytes which comprise an unsigned integer value.

Intended for use cases like very large integers that are used in cryptographic applications (e.g. keys, signatures).

Generic over a Size value (e.g. der::consts::U64), indicating the size of an integer in bytes.

Currently supported sizes are 1 - 512 bytes.

Implementations

impl<'a, N: BigUIntSize> BigUInt<'a, N>[src]

pub fn new(bytes: &'a [u8]) -> Result<Self>[src]

Create a new BigUInt from a byte slice.

Slice may be less than or equal to N bytes.

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

Borrow the inner byte slice which contains the least significant bytes of a big endian integer value with all leading zeros stripped, and may be any length from empty (i.e. zero) to N bytes.

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

Get the length of this BigUInt in bytes.

pub fn is_empty(&self) -> bool[src]

Is the inner byte slice empty?

Trait Implementations

impl<'a, N: Clone + BigUIntSize> Clone for BigUInt<'a, N>[src]

impl<'a, N: Copy + BigUIntSize> Copy for BigUInt<'a, N>[src]

impl<'a, N: Debug + BigUIntSize> Debug for BigUInt<'a, N>[src]

impl<'a, N: BigUIntSize> Encodable for BigUInt<'a, N>[src]

impl<'a, N: Eq + BigUIntSize> Eq for BigUInt<'a, N>[src]

impl<'a, N: BigUIntSize> From<&'_ BigUInt<'a, N>> for BigUInt<'a, N>[src]

impl<'a, N: PartialEq + BigUIntSize> PartialEq<BigUInt<'a, N>> for BigUInt<'a, N>[src]

impl<'a, N: BigUIntSize> StructuralEq for BigUInt<'a, N>[src]

impl<'a, N: BigUIntSize> StructuralPartialEq for BigUInt<'a, N>[src]

impl<'a, N: BigUIntSize> Tagged for BigUInt<'a, N>[src]

impl<'a, N: BigUIntSize> TryFrom<Any<'a>> for BigUInt<'a, N>[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<'a, N> RefUnwindSafe for BigUInt<'a, N> where
    N: RefUnwindSafe
[src]

impl<'a, N> Send for BigUInt<'a, N> where
    N: Send
[src]

impl<'a, N> Sync for BigUInt<'a, N> where
    N: Sync
[src]

impl<'a, N> Unpin for BigUInt<'a, N> where
    N: Unpin
[src]

impl<'a, N> UnwindSafe for BigUInt<'a, N> where
    N: UnwindSafe
[src]

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[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.