[][src]Struct der::RawInteger

pub struct RawInteger<'a> { /* fields omitted */ }

Raw ASN.1 INTEGER type.

Provides direct access to the underlying DER-encoded bytes which comprise an integer value, intended for use cases like very large integers that are used for cryptographic keys. It can be used in order to convert them to the big integer representation of your choice.

Note that the Decodable and Encodable traits are impl'd for Rust's integer primitive types (i8 only for now) if you'd like to work directly with an integer value rather than decoding it yourself.

⚠️ Important Usage Notes ⚠️

This type does NOT ensure the value is canonically encoded according to DER's rules. If it's important for your use case that the message is valid ASN.1 DER, you MUST validate the value is canonically encoded yourself.

Implementations

impl<'a> RawInteger<'a>[src]

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

Create a new RawInteger from a slice.

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

Borrow the inner byte slice.

Trait Implementations

impl<'_> AsRef<[u8]> for RawInteger<'_>[src]

impl<'a> Clone for RawInteger<'a>[src]

impl<'a> Copy for RawInteger<'a>[src]

impl<'a> Debug for RawInteger<'a>[src]

impl<'a> Encodable for RawInteger<'a>[src]

impl<'a> Eq for RawInteger<'a>[src]

impl<'a, '_> From<&'_ RawInteger<'a>> for RawInteger<'a>[src]

impl<'a> From<RawInteger<'a>> for Any<'a>[src]

impl<'a> PartialEq<RawInteger<'a>> for RawInteger<'a>[src]

impl<'a> StructuralEq for RawInteger<'a>[src]

impl<'a> StructuralPartialEq for RawInteger<'a>[src]

impl<'a> Tagged for RawInteger<'a>[src]

impl<'a> TryFrom<Any<'a>> for RawInteger<'a>[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<'a> RefUnwindSafe for RawInteger<'a>[src]

impl<'a> Send for RawInteger<'a>[src]

impl<'a> Sync for RawInteger<'a>[src]

impl<'a> Unpin for RawInteger<'a>[src]

impl<'a> UnwindSafe for RawInteger<'a>[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> 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.