docstr: Encrypt private key from the temp path
docstr_tok: ["Encrypt","private","key","from","the","temp","path"]
code: def encrypted_temporary_private_key(self, tmp_path: Path) -> Path:
      """Encrypt private key from the temp path"""
      key = rsa.generate_private_key(
          backend=default_backend(),
          public_exponent=65537,
          key_size=2048,
      )
      private_key = key.private_bytes(
          serialization.Encoding.PEM,
          serialization.PrivateFormat.PKCS8,
          encryption_algorithm=serialization.BestAvailableEncryption(
              _PASSWORD.encode()
          ),
      )
      test_key_file: Path = tmp_path / "test_key.p8"
      test_key_file.write_bytes(private_key)
      return test_key_file
  
imports: from __future__ import annotations
  import unittest
  import uuid
  from typing import TYPE_CHECKING, Any
  from unittest import mock
  from unittest.mock import AsyncMock
  import pytest
  import requests
  from cryptography.hazmat.backends import default_backend
  from cryptography.hazmat.primitives import serialization
  from cryptography.hazmat.primitives.asymmetric import rsa
  from responses import RequestsMock
  from airflow.exceptions import AirflowException
  from airflow.models import Connection
  from airflow.providers.snowflake.hooks.snowflake_sql_api import SnowflakeSqlApiHook
label_desc: Use image node_id 8 for calling the TestSnowflakeSqlApiHook obj's underlying member method code with example usage: obj.encrypted_temporary_private_key(tmp_path) and returns: test_key_file