def create_ecdsa_encrypted_pem(private_pem, passphrase):
<EOL>securesystemslib.formats.PEMRSA_SCHEMA.check_match(private_pem)<EOL>securesystemslib.formats.PASSWORD_SCHEMA.check_match(passphrase)<EOL>encrypted_pem = None<EOL>private = load_pem_private_key(private_pem.encode('<STR_LIT:utf-8>'), password=None,<EOL>backend=default_backend())<EOL>encrypted_private_pem =private.private_bytes(encoding=serialization.Encoding.PEM,<EOL>format=serialization.PrivateFormat.TraditionalOpenSSL,<EOL>encryption_algorithm=serialization.BestAvailableEncryption(passphrase.encode('<STR_LIT:utf-8>')))<EOL>return encrypted_private_pem<EOL>
<Purpose>
  Return a string in PEM format, where the private part of the ECDSA key is
  encrypted. The private part of the ECDSA key is encrypted as done by
  pyca/cryptography: "Encrypt using the best available encryption for a given
  key's backend. This is a curated encryption choice and the algorithm may
  change over time."

  >>> junk, private = generate_public_and_private()
  >>> passphrase = 'secret'
  >>> encrypted_pem = create_ecdsa_encrypted_pem(private, passphrase)
  >>> securesystemslib.formats.PEMECDSA_SCHEMA.matches(encrypted_pem)
  True

<Arguments>
  private_pem:
  The private ECDSA key string in PEM format.

  passphrase:
  The passphrase, or password, to encrypt the private part of the ECDSA
  key. 'passphrase' is not used directly as the encryption key, a stronger
  encryption key is derived from it.

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

    securesystemslib.exceptions.CryptoError, if an ECDSA key in encrypted PEM
    format cannot be created.

<Side Effects>
  None.

<Returns>
  A string in PEM format, where the private RSA portion is encrypted.
  Conforms to 'securesystemslib.formats.PEMECDSA_SCHEMA'.