net/data/ssl/scripts/crlsetutil.py
def _pem_cert_to_binary(pem_filename):
  """Decodes the first PEM-encoded certificate in a given file into binary

  Args:
    pem_filename: A filename that contains a PEM-encoded certificate. It may
        contain additional data (keys, textual representation) which will be
        ignored

  Returns:
    A byte array containing the decoded certificate data
  """
  pem_data = ""
  started = False

  with open(pem_filename, 'r') as pem_file:
    for line in pem_file:
      if not started:
        if line.startswith('-----BEGIN CERTIFICATE'):
          started = True
      else:
        if line.startswith('-----END CERTIFICATE'):
          break
        pem_data += line[:-1].strip()

  return base64.b64decode(pem_data)
Decodes the first PEM-encoded certificate in a given file into binary

  Args:
    pem_filename: A filename that contains a PEM-encoded certificate. It may
        contain additional data (keys, textual representation) which will be
        ignored

  Returns:
    A byte array containing the decoded certificate data
  
Decodes the first PEM-encoded certificate in a given file into binary
Decodes the first PEM - encoded certificate in a given file into binary
def _pem_cert_to_binary(pem_filename):
  pem_data = ""
  started = False
  with open(pem_filename, 'r') as pem_file:
    for line in pem_file:
      if not started:
        if line.startswith('-----BEGIN CERTIFICATE'):
          started = True
      else:
        if line.startswith('-----END CERTIFICATE'):
          break
        pem_data += line[:-1].strip()
  return base64.b64decode(pem_data)
def _pem_cert_to_binary ( pem_filename ) : pem_data = "" started = False with open ( pem_filename , 'r' ) as pem_file : for line in pem_file : if not started : if line . startswith ( '-----BEGIN CERTIFICATE' ) : started = True else : if line . startswith ( '-----END CERTIFICATE' ) : break pem_data += line [ : - 1 ] . strip ( ) return base64 . b64decode ( pem_data )
Decodes the first PEM-encoded certificate in a given file into binary
Decodes the first PEM - encoded certificate in a given file into binary
"""Decodes the first PEM-encoded certificate in a given file into binary

  Args:
    pem_filename: A filename that contains a PEM-encoded certificate. It may
        contain additional data (keys, textual representation) which will be
        ignored

  Returns:
    A byte array containing the decoded certificate data
  """
A byte array containing the decoded certificate data
A byte array containing the decoded certificate data
pem_filename
A filename that contains a PEM-encoded certificate. It may
contain additional data (keys, textual representation) which will be
ignored
A filename that contains a PEM - encoded certificate . It may contain additional data ( keys textual representation ) which will be ignored