def generate_rsa_key(bits=_DEFAULT_RSA_KEY_BITS, scheme='<STR_LIT>'):
<EOL>securesystemslib.formats.RSAKEYBITS_SCHEMA.check_match(bits)<EOL>securesystemslib.formats.RSA_SCHEME_SCHEMA.check_match(scheme)<EOL>rsakey_dict = {}<EOL>keytype = '<STR_LIT>'<EOL>public = None<EOL>private = None<EOL>public, private = securesystemslib.pyca_crypto_keys.generate_rsa_public_and_private(bits)<EOL>public =  extract_pem(public, private_pem=False)<EOL>private = extract_pem(private, private_pem=True)<EOL>key_value = {'<STR_LIT>': public.replace('<STR_LIT:\r\n>', '<STR_LIT:\n>'),<EOL>'<STR_LIT>': '<STR_LIT>'}<EOL>keyid = _get_keyid(keytype, scheme, key_value)<EOL>key_value['<STR_LIT>'] = private<EOL>rsakey_dict['<STR_LIT>'] = keytype<EOL>rsakey_dict['<STR_LIT>'] = scheme<EOL>rsakey_dict['<STR_LIT>'] = keyid<EOL>rsakey_dict['<STR_LIT>'] = securesystemslib.settings.HASH_ALGORITHMS<EOL>rsakey_dict['<STR_LIT>'] = key_value<EOL>return rsakey_dict<EOL>
<Purpose>
  Generate public and private RSA keys, with modulus length 'bits'.  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',
   'scheme': 'rsassa-pss-sha256',
   'keyid': keyid,
   'keyval': {'public': '-----BEGIN RSA PUBLIC KEY----- ...',
              'private': '-----BEGIN RSA PRIVATE KEY----- ...'}}

  The public and private keys are strings in PEM format.

  Although the PyCA cryptography library and/or its crypto backend might set
  a minimum key size, generate() enforces a minimum key size of 2048 bits.
  If 'bits' is unspecified, a 3072-bit RSA key is generated, which is the key
  size recommended by securesystemslib.  These key size restrictions are only
  enforced for keys generated within securesystemslib.  RSA keys with sizes
  lower than what we recommended may still be imported (e.g., with
  import_rsakey_from_pem().

  >>> rsa_key = generate_rsa_key(bits=2048)
  >>> securesystemslib.formats.RSAKEY_SCHEMA.matches(rsa_key)
  True

  >>> public = rsa_key['keyval']['public']
  >>> private = rsa_key['keyval']['private']
  >>> securesystemslib.formats.PEMRSA_SCHEMA.matches(public)
  True
  >>> securesystemslib.formats.PEMRSA_SCHEMA.matches(private)
  True

<Arguments>
  bits:
    The key size, or key length, of the RSA key.  'bits' must be 2048, or
    greater, and a multiple of 256.

  scheme:
    The signature scheme used by the key.  It must be one of
    ['rsassa-pss-sha256'].

<Exceptions>
  securesystemslib.exceptions.FormatError, if 'bits' is improperly or invalid
  (i.e., not an integer and not at least 2048).

  ValueError, if an exception occurs after calling the RSA key generation
  routine.  The 'ValueError' exception is raised by the key generation
  function of the cryptography library called.

<Side Effects>
  None.

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