'Add a temporary EC key to C{context}.
@param context: The context to add a key to.
@type context: L{OpenSSL.SSL.Context}'

def addECKeyToContext(self, context):

    ecKey = self._lib.EC_KEY_new_by_curve_name(self._nid)
    if (ecKey == self._ffi.NULL):
        raise EnvironmentError('EC    key    creation    failed.')
    self._lib.SSL_CTX_set_tmp_ecdh(context._context, ecKey)
    self._lib.EC_KEY_free(ecKey)
