Struct TaggedParser
pub struct TaggedParser<'a, TagKind, T, E = Error> {
pub header: Header<'a>,
pub inner: T,
/* private fields */
}Available on crate feature
crypto only.Fields§
§header: Header<'a>§inner: TImplementations§
§impl<'a, T, E> TaggedParser<'a, Explicit, T, E>
impl<'a, T, E> TaggedParser<'a, Explicit, T, E>
pub const fn new_explicit( class: Class, tag: u32, inner: T, ) -> TaggedParser<'a, Explicit, T, E>
pub fn from_ber_and_then<F>(
class: Class,
tag: u32,
bytes: &'a [u8],
op: F,
) -> Result<(&'a [u8], T), Err<E>>
pub fn from_ber_and_then<F>( class: Class, tag: u32, bytes: &'a [u8], op: F, ) -> Result<(&'a [u8], T), Err<E>>
Parse a BER tagged value and apply the provided parsing function to content
After parsing, the sequence object and header are discarded.
Note: this function is provided for Explicit, but there is not difference between
explicit or implicit tags. The op function is responsible of handling the content.
pub fn from_der_and_then<F>(
class: Class,
tag: u32,
bytes: &'a [u8],
op: F,
) -> Result<(&'a [u8], T), Err<E>>
pub fn from_der_and_then<F>( class: Class, tag: u32, bytes: &'a [u8], op: F, ) -> Result<(&'a [u8], T), Err<E>>
Parse a DER tagged value and apply the provided parsing function to content
After parsing, the sequence object and header are discarded.
Note: this function is provided for Explicit, but there is not difference between
explicit or implicit tags. The op function is responsible of handling the content.
§impl<T, E> TaggedParser<'_, Implicit, T, E>
impl<T, E> TaggedParser<'_, Implicit, T, E>
pub const fn new_implicit( class: Class, constructed: bool, tag: u32, inner: T, ) -> TaggedParser<'_, Implicit, T, E>
§impl<'a, TagKind, T, E> TaggedParser<'a, TagKind, T, E>
impl<'a, TagKind, T, E> TaggedParser<'a, TagKind, T, E>
§impl<'a, TagKind, T, E> TaggedParser<'a, TagKind, T, E>
impl<'a, TagKind, T, E> TaggedParser<'a, TagKind, T, E>
§impl<'a, TagKind, T, E> TaggedParser<'a, TagKind, T, E>
impl<'a, TagKind, T, E> TaggedParser<'a, TagKind, T, E>
Trait Implementations§
§impl<TagKind, T, E> AsRef<T> for TaggedParser<'_, TagKind, T, E>
impl<TagKind, T, E> AsRef<T> for TaggedParser<'_, TagKind, T, E>
§impl<T> CheckDerConstraints for TaggedParser<'_, Explicit, T>where
T: CheckDerConstraints,
impl<T> CheckDerConstraints for TaggedParser<'_, Explicit, T>where
T: CheckDerConstraints,
§impl<T> CheckDerConstraints for TaggedParser<'_, Implicit, T>where
T: CheckDerConstraints + Tagged,
impl<T> CheckDerConstraints for TaggedParser<'_, Implicit, T>where
T: CheckDerConstraints + Tagged,
§impl<'a, TagKind, T, E> Debug for TaggedParser<'a, TagKind, T, E>
impl<'a, TagKind, T, E> Debug for TaggedParser<'a, TagKind, T, E>
§impl<'a, T, E> FromBer<'a, E> for TaggedParser<'a, Explicit, T, E>
impl<'a, T, E> FromBer<'a, E> for TaggedParser<'a, Explicit, T, E>
§impl<'a, T, E> FromBer<'a, E> for TaggedParser<'a, Implicit, T, E>
impl<'a, T, E> FromBer<'a, E> for TaggedParser<'a, Implicit, T, E>
§impl<'a, T, E> FromDer<'a, E> for TaggedParser<'a, Explicit, T, E>
impl<'a, T, E> FromDer<'a, E> for TaggedParser<'a, Explicit, T, E>
§impl<'a, T, E> FromDer<'a, E> for TaggedParser<'a, Implicit, T, E>
impl<'a, T, E> FromDer<'a, E> for TaggedParser<'a, Implicit, T, E>
§impl<'a, TagKind, T, E> PartialEq for TaggedParser<'a, TagKind, T, E>
impl<'a, TagKind, T, E> PartialEq for TaggedParser<'a, TagKind, T, E>
§impl<T> ToDer for TaggedParser<'_, Explicit, T>where
T: ToDer,
Available on crate feature std only.
impl<T> ToDer for TaggedParser<'_, Explicit, T>where
T: ToDer,
Available on crate feature
std only.§fn to_der_len(&self) -> Result<usize, Error>
fn to_der_len(&self) -> Result<usize, Error>
Get the length of the object (including the header), when encoded
§fn write_der_header(
&self,
writer: &mut dyn Write,
) -> Result<usize, SerializeError>
fn write_der_header( &self, writer: &mut dyn Write, ) -> Result<usize, SerializeError>
Attempt to write the DER header to this writer.
§fn write_der_content(
&self,
writer: &mut dyn Write,
) -> Result<usize, SerializeError>
fn write_der_content( &self, writer: &mut dyn Write, ) -> Result<usize, SerializeError>
Attempt to write the DER content (all except header) to this writer.
§fn to_der_vec(&self) -> Result<Vec<u8>, SerializeError>
fn to_der_vec(&self) -> Result<Vec<u8>, SerializeError>
Write the DER encoded representation to a newly allocated
Vec<u8>.§fn to_der_vec_raw(&self) -> Result<Vec<u8>, SerializeError>
fn to_der_vec_raw(&self) -> Result<Vec<u8>, SerializeError>
Similar to using
to_vec, but uses provided values without changes.
This can generate an invalid encoding for a DER object.§fn write_der(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>
fn write_der(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>
Attempt to write the DER encoded representation (header and content) into this writer. Read more
§fn write_der_raw(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>
fn write_der_raw(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>
Similar to using
to_der, but uses provided values without changes.
This can generate an invalid encoding for a DER object.§impl<T> ToDer for TaggedParser<'_, Implicit, T>where
T: ToDer,
Available on crate feature std only.
impl<T> ToDer for TaggedParser<'_, Implicit, T>where
T: ToDer,
Available on crate feature
std only.§fn to_der_len(&self) -> Result<usize, Error>
fn to_der_len(&self) -> Result<usize, Error>
Get the length of the object (including the header), when encoded
§fn write_der(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>
fn write_der(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>
Attempt to write the DER encoded representation (header and content) into this writer. Read more
§fn write_der_header(
&self,
writer: &mut dyn Write,
) -> Result<usize, SerializeError>
fn write_der_header( &self, writer: &mut dyn Write, ) -> Result<usize, SerializeError>
Attempt to write the DER header to this writer.
§fn write_der_content(
&self,
writer: &mut dyn Write,
) -> Result<usize, SerializeError>
fn write_der_content( &self, writer: &mut dyn Write, ) -> Result<usize, SerializeError>
Attempt to write the DER content (all except header) to this writer.
§fn to_der_vec(&self) -> Result<Vec<u8>, SerializeError>
fn to_der_vec(&self) -> Result<Vec<u8>, SerializeError>
Write the DER encoded representation to a newly allocated
Vec<u8>.§fn to_der_vec_raw(&self) -> Result<Vec<u8>, SerializeError>
fn to_der_vec_raw(&self) -> Result<Vec<u8>, SerializeError>
Similar to using
to_vec, but uses provided values without changes.
This can generate an invalid encoding for a DER object.§fn write_der_raw(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>
fn write_der_raw(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>
Similar to using
to_der, but uses provided values without changes.
This can generate an invalid encoding for a DER object.impl<'a, TagKind, T, E> Eq for TaggedParser<'a, TagKind, T, E>
impl<'a, TagKind, T, E> StructuralPartialEq for TaggedParser<'a, TagKind, T, E>
Auto Trait Implementations§
impl<'a, TagKind, T, E> Freeze for TaggedParser<'a, TagKind, T, E>where
T: Freeze,
impl<'a, TagKind, T, E> RefUnwindSafe for TaggedParser<'a, TagKind, T, E>
impl<'a, TagKind, T, E> Send for TaggedParser<'a, TagKind, T, E>
impl<'a, TagKind, T, E> Sync for TaggedParser<'a, TagKind, T, E>
impl<'a, TagKind, T, E> Unpin for TaggedParser<'a, TagKind, T, E>
impl<'a, TagKind, T, E> UnwindSafe for TaggedParser<'a, TagKind, T, E>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Create a new
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more