pub struct Element<'a> {
pub tag: u8,
pub content: &'a [u8],
pub raw: &'a [u8],
}Available on crate feature
rustcrypto only.Expand description
One DER element: its identifier octet and the content it wraps.
Fields§
§tag: u8The identifier octet — a TAG_SEQUENCE or a context_constructed, say.
content: &'a [u8]The content octets, borrowed from the input.
raw: &'a [u8]The whole element including its header, which is what a signature covers when the
element is a tbsCertificate or a certificationRequestInfo.
Implementations§
Source§impl<'a> Element<'a>
impl<'a> Element<'a>
Sourcepub const fn content_reader(&self) -> DerReader<'a>
pub const fn content_reader(&self) -> DerReader<'a>
A reader over this element’s content, for a constructed type.
Sourcepub fn bit_string_octets(&self) -> Result<&'a [u8]>
pub fn bit_string_octets(&self) -> Result<&'a [u8]>
The content as a BIT STRING’s bits, refusing any that are not whole octets.
A BIT STRING’s first content octet counts the unused bits in its last octet.
Everything Matter puts in one — a public key, a signature — is whole octets, so a
non-zero count is a malformed encoding rather than something to round.
Trait Implementations§
impl<'a> Copy for Element<'a>
impl<'a> Eq for Element<'a>
impl<'a> StructuralPartialEq for Element<'a>
Auto Trait Implementations§
impl<'a> Forget for Element<'a>
impl<'a> Freeze for Element<'a>
impl<'a> Move for Element<'a>
impl<'a> RefUnwindSafe for Element<'a>
impl<'a> Send for Element<'a>
impl<'a> Sync for Element<'a>
impl<'a> Unpin for Element<'a>
impl<'a> UnsafeUnpin for Element<'a>
impl<'a> UnwindSafe for Element<'a>
Blanket Implementations§
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