commit 7444d4cbacc019a3b4e47709c50c567386a25ae6
Author: Stanislav Král <stanislav.kral3@gmail.com>
Date:   Wed Mar 31 10:55:35 2021 +0200

    Re #8472 - Changed access modifier of run_for_output method to private (was protected previously)

diff --git a/proj/services/cryptography.py b/proj/services/cryptography.py
index 72594c6..33ef836 100644
--- a/proj/services/cryptography.py
+++ b/proj/services/cryptography.py
@@ -38,7 +38,7 @@ class CryptographyService:
         return "".join([f"/{key}={value}" for key, value in subj_dict.items()])
 
     @staticmethod
-    def _run_for_output(args=None, proc_input=None, executable=OPENSSL_EXECUTABLE):
+    def __run_for_output(args=None, proc_input=None, executable=OPENSSL_EXECUTABLE):
         """
         Launches a new process in which the given executable is run. STDIN and process arguments can be set.
         If the process ends with a non-zero then <CryptographyException> is raised.
@@ -81,9 +81,9 @@ class CryptographyService:
         :return: string containing the generated private key in PEM format
         """
         if passphrase is None or len(passphrase) == 0:
-            return self._run_for_output(["genrsa", "2048"]).decode()
+            return self.__run_for_output(["genrsa", "2048"]).decode()
         else:
-            return self._run_for_output(
+            return self.__run_for_output(
                 ["genrsa", PRIVATE_KEY_ENCRYPTION_METHOD, "-passout", f"pass:{passphrase}", "2048"]).decode()
 
     def create_sscrt(self, key, subject, config="", extensions="", key_pass=None):
@@ -119,7 +119,7 @@ class CryptographyService:
             # waiting for the passphrase to be typed in
             args.extend(["-passin", f"pass:{key_pass}"])
 
-            return self._run_for_output(args, proc_input=bytes(key, encoding="utf-8")).decode()
+            return self.__run_for_output(args, proc_input=bytes(key, encoding="utf-8")).decode()
 
     def __create_csr(self, subject, subject_key, subject_key_pass=""):
         """
@@ -139,7 +139,7 @@ class CryptographyService:
         # waiting for the passphrase to be typed in
         args.extend(["-passin", f"pass:{subject_key_pass}"])
 
-        return self._run_for_output(args, proc_input=bytes(subject_key, encoding="utf-8")).decode()
+        return self.__run_for_output(args, proc_input=bytes(subject_key, encoding="utf-8")).decode()
 
     def __sign_csr(self, csr, issuer_pem, issuer_key, issuer_key_pass=None, extensions="", days=30):
         """
@@ -172,7 +172,7 @@ class CryptographyService:
             if len(extensions) > 0:
                 params.extend(["-extfile", ext_path])
 
-            return self._run_for_output(params, proc_input=(bytes(proc_input, encoding="utf-8"))).decode()
+            return self.__run_for_output(params, proc_input=(bytes(proc_input, encoding="utf-8"))).decode()
 
     def create_crt(self, subject, subject_key, issuer_pem, issuer_key, subject_key_pass=None, issuer_key_pass=None,
                    extensions="",
diff --git a/proj/tests/services/cryptography/run_for_output_test.py b/proj/tests/services/cryptography/run_for_output_test.py
index 842e28f..558a3fa 100644
--- a/proj/tests/services/cryptography/run_for_output_test.py
+++ b/proj/tests/services/cryptography/run_for_output_test.py
@@ -4,24 +4,24 @@ from proj.services.cryptography import CryptographyException
 
 
 def test_simple_exec(service):
-    out = service._run_for_output(["version"])
+    out = service._CryptographyService__run_for_output(["version"])
     assert "OpenSSL" in out.decode()
 
 
 def test_simple_exec_without_parameters(service):
-    out = service._run_for_output()
+    out = service._CryptographyService__run_for_output()
     assert "OpenSSL>" in out.decode()
 
 
 def test_nonexistent_executable(service):
     with pytest.raises(CryptographyException) as e:
-        service._run_for_output(executable="nonexistent_executable#")
+        service._CryptographyService__run_for_output(executable="nonexistent_executable#")
     assert """"nonexistent_executable#" not found in the current PATH.""" in e.value.message
 
 
 def test_exception_str(service):
     with pytest.raises(CryptographyException) as e:
-        service._run_for_output(executable="nonexistent_executable")
+        service._CryptographyService__run_for_output(executable="nonexistent_executable")
     assert """EXECUTABLE: nonexistent_executable
         ARGS: ('nonexistent_executable',)
         MESSAGE: "nonexistent_executable" not found in the current PATH.""" in e.value.__str__()
