def create_signature(public_key, private_key, data, scheme='<STR_LIT>'):
<EOL>securesystemslib.formats.PEMECDSA_SCHEMA.check_match(public_key)<EOL>securesystemslib.formats.PEMECDSA_SCHEMA.check_match(private_key)<EOL>securesystemslib.formats.ECDSA_SCHEME_SCHEMA.check_match(scheme)<EOL>if scheme == '<STR_LIT>':<EOL><INDENT>try:<EOL><INDENT>private_key = load_pem_private_key(private_key.encode('<STR_LIT:utf-8>'),<EOL>password=None, backend=default_backend())<EOL>signature = private_key.sign(data, ec.ECDSA(hashes.SHA256()))<EOL><DEDENT>except TypeError as e:<EOL><INDENT>raise securesystemslib.exceptions.CryptoError('<STR_LIT>'<EOL>'<STR_LIT>' + str(e))<EOL><DEDENT><DEDENT>else: <EOL><INDENT>raise securesystemslib.exceptions.UnsupportedAlgorithmError('<STR_LIT>'<EOL>'<STR_LIT>' + repr(scheme))<EOL><DEDENT>return signature, scheme<EOL>
<Purpose>
  Return a (signature, scheme) tuple.

  >>> requested_scheme = 'ecdsa-sha2-nistp256'
  >>> public, private = generate_public_and_private(requested_scheme)
  >>> data = b'The quick brown fox jumps over the lazy dog'
  >>> signature, scheme = create_signature(public, private, data, requested_scheme)
  >>> securesystemslib.formats.ECDSASIGNATURE_SCHEMA.matches(signature)
  True
  >>> requested_scheme == scheme
  True

<Arguments>
  public:
    The ECDSA public key in PEM format.

  private:
    The ECDSA private key in PEM format.

  data:
    Byte data used by create_signature() to generate the signature returned.

  scheme:
    The signature scheme used to generate the signature.  For example:
    'ecdsa-sha2-nistp256'.

<Exceptions>
  securesystemslib.exceptions.FormatError, if the arguments are improperly
  formatted.

  securesystemslib.exceptions.CryptoError, if a signature cannot be created.

  securesystemslib.exceptions.UnsupportedAlgorithmError, if 'scheme' is not
  one of the supported signature schemes.

<Side Effects>
  None.

<Returns>
  A signature dictionary conformat to
  'securesystemslib.format.SIGNATURE_SCHEMA'.  ECDSA signatures are XX bytes,
  however, the hexlified signature is stored in the dictionary returned.