[−][src]Struct der::RawInteger
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]
pub fn clone(&self) -> RawInteger<'a>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Copy for RawInteger<'a>
[src]
impl<'a> Debug for RawInteger<'a>
[src]
impl<'a> Encodable for RawInteger<'a>
[src]
pub fn encoded_len(&self) -> Result<Length>
[src]
pub fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>
[src]
pub fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>
[src]
pub fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length>
[src]
pub fn to_vec(&self) -> Result<Vec<u8>>
[src]
impl<'a> Eq for RawInteger<'a>
[src]
impl<'a, '_> From<&'_ RawInteger<'a>> for RawInteger<'a>
[src]
pub fn from(value: &RawInteger<'a>) -> RawInteger<'a>
[src]
impl<'a> From<RawInteger<'a>> for Any<'a>
[src]
pub fn from(integer: RawInteger<'a>) -> Any<'a>
[src]
impl<'a> PartialEq<RawInteger<'a>> for RawInteger<'a>
[src]
pub fn eq(&self, other: &RawInteger<'a>) -> bool
[src]
pub fn ne(&self, other: &RawInteger<'a>) -> bool
[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]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,