MCPcopy Create free account
hub / github.com/RustCrypto/formats / decode_sequence

Function decode_sequence

der/src/document.rs:334–340  ·  view source on GitHub ↗

Attempt to decode a ASN.1 `SEQUENCE` from the given decoder, returning the entire sequence including the header.

(decoder: &mut SliceReader<'a>)

Source from the content-addressed store, hash-verified

332/// Attempt to decode a ASN.1 `SEQUENCE` from the given decoder, returning the
333/// entire sequence including the header.
334fn decode_sequence<'a>(decoder: &mut SliceReader<'a>) -> Result<&'a [u8]> {
335 let header = decoder.peek_header()?;
336 header.tag.assert_eq(Tag::Sequence)?;
337
338 let len = (header.encoded_len()? + header.length)?;
339 decoder.read_slice(len)
340}
341
342/// Write a file containing secret data to the filesystem, restricting the
343/// file permissions so it's only readable by the owner

Callers 1

try_fromMethod · 0.85

Calls 4

assert_eqMethod · 0.80
peek_headerMethod · 0.45
encoded_lenMethod · 0.45
read_sliceMethod · 0.45

Tested by

no test coverage detected