[−][src]Function asn1_der::der::decode_length
pub fn decode_length(length_bytes: &[u8]) -> Result<(usize, usize)>
Decodes an ASN.1-DER-encoded length
Parameters:
length_bytes
: A slice over (but not limited to) the encoded length that begins with the first length-byte
Returns:
- On success:
(payload_length, number_of_length_bytes)
- On error:
Asn1DerError::InvalidEncoding
if the length-field is invalidAsn1DerError::NotEnoughBytes
if the length-field is too shortAsn1DerError::Unsupported
if the length is greater thanstd::usize::MAX