def import_rsakey_from_public_pem(pem, scheme='<STR_LIT>'):
<EOL>securesystemslib.formats.PEMRSA_SCHEMA.check_match(pem)<EOL>securesystemslib.formats.RSA_SCHEME_SCHEMA.check_match(scheme)<EOL>if is_pem_public(pem):<EOL><INDENT>public_pem = extract_pem(pem, private_pem=False)<EOL><DEDENT>else:<EOL><INDENT>raise securesystemslib.exceptions.FormatError('<STR_LIT>'<EOL>'<STR_LIT>' + repr(pem))<EOL><DEDENT>rsakey_dict = {}<EOL>keytype = '<STR_LIT>'<EOL>key_value = {'<STR_LIT>': public_pem.replace('<STR_LIT:\r\n>', '<STR_LIT:\n>'),<EOL>'<STR_LIT>': '<STR_LIT>'}<EOL>keyid = _get_keyid(keytype, scheme, key_value)<EOL>rsakey_dict['<STR_LIT>'] = keytype<EOL>rsakey_dict['<STR_LIT>'] = scheme<EOL>rsakey_dict['<STR_LIT>'] = keyid<EOL>rsakey_dict['<STR_LIT>'] = key_value<EOL>rsakey_dict['<STR_LIT>'] =securesystemslib.settings.HASH_ALGORITHMS<EOL>return rsakey_dict<EOL>
<Purpose>
  Generate an RSA key object from 'pem'.  In addition, a keyid identifier for
  the RSA key is generated.  The object returned conforms to
  'securesystemslib.formats.RSAKEY_SCHEMA' and has the form:

  {'keytype': 'rsa',
   'keyid': keyid,
   'keyval': {'public': '-----BEGIN PUBLIC KEY----- ...',
              'private': ''}}

  The public portion of the RSA key is a string in PEM format.

  >>> rsa_key = generate_rsa_key()
  >>> public = rsa_key['keyval']['public']
  >>> rsa_key['keyval']['private'] = ''
  >>> rsa_key2 = import_rsakey_from_public_pem(public)
  >>> securesystemslib.formats.RSAKEY_SCHEMA.matches(rsa_key)
  True
  >>> securesystemslib.formats.RSAKEY_SCHEMA.matches(rsa_key2)
  True

<Arguments>
  pem:
    A string in PEM format (it should contain a public RSA key).

<Exceptions>
  securesystemslib.exceptions.FormatError, if 'pem' is improperly formatted.

<Side Effects>
  Only the public portion of the PEM is extracted.  Leading or trailing
  whitespace is not included in the PEM string stored in the rsakey object
  returned.

<Returns>
  A dictionary containing the RSA keys and other identifying information.
  Conforms to 'securesystemslib.formats.RSAKEY_SCHEMA'.