net/data/ssl/scripts/crlsetutil.py
def _parse_asn1_element(der_bytes):
  """Parses a DER-encoded tag/Length/Value into its component parts

  Args:
    der_bytes: A DER-encoded ASN.1 data type

  Returns:
    A tuple of the ASN.1 tag value, the length of the ASN.1 header that was
    read, the sequence of bytes for the value, and then any data from der_bytes
    that was not part of the tag/Length/Value.
  """
  tag = six.indexbytes(der_bytes, 0)
  length = six.indexbytes(der_bytes, 1)
  header_length = 2

  if length & 0x80:
    num_length_bytes = length & 0x7f
    length = 0
    for i in range(2, 2 + num_length_bytes):
      length <<= 8
      length += six.indexbytes(der_bytes, i)
    header_length = 2 + num_length_bytes

  contents = der_bytes[:header_length + length]
  rest = der_bytes[header_length + length:]

  return (tag, header_length, contents, rest)
Parses a DER-encoded tag/Length/Value into its component parts

  Args:
    der_bytes: A DER-encoded ASN.1 data type

  Returns:
    A tuple of the ASN.1 tag value, the length of the ASN.1 header that was
    read, the sequence of bytes for the value, and then any data from der_bytes
    that was not part of the tag/Length/Value.
  
Parses a DER-encoded tag/Length/Value into its component parts
Parses a DER - encoded tag / Length / Value into its component parts
def _parse_asn1_element(der_bytes):
  tag = six.indexbytes(der_bytes, 0)
  length = six.indexbytes(der_bytes, 1)
  header_length = 2
  if length & 0x80:
    num_length_bytes = length & 0x7f
    length = 0
    for i in range(2, 2 + num_length_bytes):
      length <<= 8
      length += six.indexbytes(der_bytes, i)
    header_length = 2 + num_length_bytes
  contents = der_bytes[:header_length + length]
  rest = der_bytes[header_length + length:]
  return (tag, header_length, contents, rest)
def _parse_asn1_element ( der_bytes ) : tag = six . indexbytes ( der_bytes , 0 ) length = six . indexbytes ( der_bytes , 1 ) header_length = 2 if length & 0x80 : num_length_bytes = length & 0x7f length = 0 for i in range ( 2 , 2 + num_length_bytes ) : length <<= 8 length += six . indexbytes ( der_bytes , i ) header_length = 2 + num_length_bytes contents = der_bytes [ : header_length + length ] rest = der_bytes [ header_length + length : ] return ( tag , header_length , contents , rest )
Parses a DER-encoded tag/Length/Value into its component parts
Parses a DER - encoded tag / Length / Value into its component parts
"""Parses a DER-encoded tag/Length/Value into its component parts

  Args:
    der_bytes: A DER-encoded ASN.1 data type

  Returns:
    A tuple of the ASN.1 tag value, the length of the ASN.1 header that was
    read, the sequence of bytes for the value, and then any data from der_bytes
    that was not part of the tag/Length/Value.
  """
A tuple of the ASN.1 tag value, the length of the ASN.1 header that was
read, the sequence of bytes for the value, and then any data from der_bytes
that was not part of the tag/Length/Value.
A tuple of the ASN . 1 tag value the length of the ASN . 1 header that was read the sequence of bytes for the value and then any data from der_bytes that was not part of the tag / Length / Value .
der_bytes
A DER-encoded ASN.1 data type
A DER - encoded ASN . 1 data type