def generate_rsa_public_and_private(bits=_DEFAULT_RSA_KEY_BITS):
<EOL>securesystemslib.formats.RSAKEYBITS_SCHEMA.check_match(bits)<EOL>private_key = rsa.generate_private_key(public_exponent=<NUM_LIT>, key_size=bits,<EOL>backend=default_backend())<EOL>private_pem = private_key.private_bytes(encoding=serialization.Encoding.PEM,<EOL>format=serialization.PrivateFormat.TraditionalOpenSSL,<EOL>encryption_algorithm=serialization.NoEncryption())<EOL>public_key = private_key.public_key()<EOL>public_pem = public_key.public_bytes(encoding=serialization.Encoding.PEM,<EOL>format=serialization.PublicFormat.SubjectPublicKeyInfo)<EOL>return public_pem.decode('<STR_LIT:utf-8>'), private_pem.decode('<STR_LIT:utf-8>')<EOL>
<Purpose>
  Generate public and private RSA keys with modulus length 'bits'.  The
  public and private keys returned conform to
  'securesystemslib.formats.PEMRSA_SCHEMA' and have the form:

  '-----BEGIN RSA PUBLIC KEY----- ...'

  or

  '-----BEGIN RSA PRIVATE KEY----- ...'

  The public and private keys are returned as strings in PEM format.

  'generate_rsa_public_and_private()' 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 TUF.

  >>> public, private = generate_rsa_public_and_private(2048)
  >>> 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.  'bits' defaults to 3072 if not specified.

<Exceptions>
  securesystemslib.exceptions.FormatError, if 'bits' does not contain the
  correct format.

<Side Effects>
  The RSA keys are generated from pyca/cryptography's
  rsa.generate_private_key() function.

<Returns>
  A (public, private) tuple containing the RSA keys in PEM format.