pub struct BigInt<'a> { /* private fields */ }
Expand description
Arbitrary sized signed integer. Contents may be accessed as &[u8]
of
big-endian data. Its contents always match the DER encoding of a value
(i.e. they are minimal)
Implementations§
source§impl<'a> BigInt<'a>
impl<'a> BigInt<'a>
sourcepub fn new(data: &'a [u8]) -> Option<Self>
pub fn new(data: &'a [u8]) -> Option<Self>
Create a new BigInt
from already encoded data. data
must be encoded
as required by DER: minimally and if the high bit would be set in the
first octet, a leading \x00
should be prepended (to disambiguate from
negative values).
sourcepub fn is_negative(&self) -> bool
pub fn is_negative(&self) -> bool
Returns a boolean indicating whether the integer is negative.
Trait Implementations§
source§impl<'a> PartialEq for BigInt<'a>
impl<'a> PartialEq for BigInt<'a>
source§impl<'a> SimpleAsn1Readable<'a> for BigInt<'a>
impl<'a> SimpleAsn1Readable<'a> for BigInt<'a>
const TAG: Tag = _
fn parse_data(data: &'a [u8]) -> ParseResult<Self>
source§impl<'a> SimpleAsn1Writable for BigInt<'a>
impl<'a> SimpleAsn1Writable for BigInt<'a>
const TAG: Tag = _
fn write_data(&self, dest: &mut WriteBuf) -> WriteResult
impl<'a> Copy for BigInt<'a>
impl<'a> Eq for BigInt<'a>
impl<'a> StructuralPartialEq for BigInt<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for BigInt<'a>
impl<'a> Send for BigInt<'a>
impl<'a> Sync for BigInt<'a>
impl<'a> Unpin for BigInt<'a>
impl<'a> UnwindSafe for BigInt<'a>
Blanket Implementations§
source§impl<'a, T> Asn1Readable<'a> for Twhere
T: SimpleAsn1Readable<'a>,
impl<'a, T> Asn1Readable<'a> for Twhere
T: SimpleAsn1Readable<'a>,
source§impl<T> Asn1Writable for Twhere
T: SimpleAsn1Writable,
impl<T> Asn1Writable for Twhere
T: SimpleAsn1Writable,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more