def create_rsa_signature(private_key, data, scheme='<STR_LIT>'):
<EOL>securesystemslib.formats.PEMRSA_SCHEMA.check_match(private_key)<EOL>securesystemslib.formats.DATA_SCHEMA.check_match(data)<EOL>securesystemslib.formats.RSA_SCHEME_SCHEMA.check_match(scheme)<EOL>signature = None<EOL>if len(private_key):<EOL><INDENT>if scheme == '<STR_LIT>':<EOL><INDENT>try:<EOL><INDENT>private_key_object = load_pem_private_key(private_key.encode('<STR_LIT:utf-8>'),<EOL>password=None, backend=default_backend())<EOL>signature = private_key_object.sign(<EOL>data, padding.PSS(mgf=padding.MGF1(hashes.SHA256()),<EOL>salt_length=hashes.SHA256().digest_size), hashes.SHA256())<EOL><DEDENT>except ValueError:<EOL><INDENT>raise securesystemslib.exceptions.CryptoError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>except TypeError:<EOL><INDENT>raise securesystemslib.exceptions.CryptoError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>except cryptography.exceptions.UnsupportedAlgorithm: <EOL><INDENT>raise securesystemslib.exceptions.CryptoError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>else: <EOL><INDENT>raise securesystemslib.exceptions.UnsupportedAlgorithmError('<STR_LIT>'<EOL>'<STR_LIT>' + repr(scheme))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>return signature, scheme<EOL>
<Purpose>
  Generate a 'scheme' signature.  The signature, and the signature scheme
  used, is returned as a (signature, scheme) tuple.

  The signing process will use 'private_key' to generate the signature of
  'data'.

  RFC3447 - RSASSA-PSS
  http://www.ietf.org/rfc/rfc3447.txt

  >>> public, private = generate_rsa_public_and_private(2048)
  >>> data = 'The quick brown fox jumps over the lazy dog'.encode('utf-8')
  >>> scheme = 'rsassa-pss-sha256'
  >>> signature, scheme = create_rsa_signature(private, data, scheme)
  >>> securesystemslib.formats.NAME_SCHEMA.matches(scheme)
  True
  >>> scheme == 'rsassa-pss-sha256'
  True
  >>> securesystemslib.formats.PYCACRYPTOSIGNATURE_SCHEMA.matches(signature)
  True

<Arguments>
  private_key:
    The private RSA key, a string in PEM format.

  data:
    Data (string) used by create_rsa_signature() to generate the signature.

  scheme:
    The signature scheme used to generate the signature.

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

  ValueError, if 'private_key' is unset.

  securesystemslib.exceptions.CryptoError, if the signature cannot be
  generated.

<Side Effects>
  pyca/cryptography's 'RSAPrivateKey.signer()' called to generate the
  signature.

<Returns>
  A (signature, scheme) tuple, where the signature is a string and the scheme
  is one of the supported RSA signature schemes. For example:
  'rsassa-pss-sha256'.