Struct ed25519_dalek::pkcs8::spki::der::IndefiniteLength
pub struct IndefiniteLength(/* private fields */);
pkcs8
only.Expand description
Length type with support for indefinite lengths as used by ASN.1 BER, as described in X.690 Section 8.1.3.6:
8.1.3.6 For the indefinite form, the length octets indicate that the contents octets are terminated by end-of-contents octets (see 8.1.5), and shall consist of a single octet.
8.1.3.6.1 The single octet shall have bit 8 set to one, and bits 7 to 1 set to zero.
8.1.3.6.2 If this form of length is used, then end-of-contents octets (see 8.1.5) shall be present in the encoding following the contents octets.
Indefinite lengths are non-canonical and therefore invalid DER, however there are interoperability corner cases where we have little choice but to tolerate some BER productions where this is helpful.
Implementations§
§impl IndefiniteLength
impl IndefiniteLength
pub const ZERO: IndefiniteLength = _
pub const ZERO: IndefiniteLength = _
Length of 0
.
pub const ONE: IndefiniteLength = _
pub const ONE: IndefiniteLength = _
Length of 1
.
pub const INDEFINITE: IndefiniteLength = _
pub const INDEFINITE: IndefiniteLength = _
Indefinite length.
§impl IndefiniteLength
impl IndefiniteLength
pub fn new(length: impl Into<Length>) -> IndefiniteLength
pub fn new(length: impl Into<Length>) -> IndefiniteLength
Create a definite length from a type which can be converted into a
Length
.
pub fn is_definite(self) -> bool
pub fn is_definite(self) -> bool
Is this length definite?
pub fn is_indefinite(self) -> bool
pub fn is_indefinite(self) -> bool
Is this length indefinite?
Trait Implementations§
§impl Clone for IndefiniteLength
impl Clone for IndefiniteLength
§fn clone(&self) -> IndefiniteLength
fn clone(&self) -> IndefiniteLength
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for IndefiniteLength
impl Debug for IndefiniteLength
§impl<'a> Decode<'a> for IndefiniteLength
impl<'a> Decode<'a> for IndefiniteLength
§impl Encode for IndefiniteLength
impl Encode for IndefiniteLength
§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Writer
.§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
§impl From<Length> for IndefiniteLength
impl From<Length> for IndefiniteLength
§fn from(length: Length) -> IndefiniteLength
fn from(length: Length) -> IndefiniteLength
§impl From<Option<Length>> for IndefiniteLength
impl From<Option<Length>> for IndefiniteLength
§fn from(length: Option<Length>) -> IndefiniteLength
fn from(length: Option<Length>) -> IndefiniteLength
§impl Ord for IndefiniteLength
impl Ord for IndefiniteLength
§fn cmp(&self, other: &IndefiniteLength) -> Ordering
fn cmp(&self, other: &IndefiniteLength) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for IndefiniteLength
impl PartialEq for IndefiniteLength
§fn eq(&self, other: &IndefiniteLength) -> bool
fn eq(&self, other: &IndefiniteLength) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd for IndefiniteLength
impl PartialOrd for IndefiniteLength
§fn partial_cmp(&self, other: &IndefiniteLength) -> Option<Ordering>
fn partial_cmp(&self, other: &IndefiniteLength) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more