commit 87a7a4a565ce66882df524e1f3809437695f3f54
Author: Stanislav Král <stanislav.kral3@gmail.com>
Date:   Wed Mar 31 10:51:32 2021 +0200

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

diff --git a/proj/services/cryptography.py b/proj/services/cryptography.py
index 3955d81..91c7d34 100644
--- a/proj/services/cryptography.py
+++ b/proj/services/cryptography.py
@@ -136,7 +136,7 @@ class CryptographyService:
 
         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):
+    def __sign_csr(self, csr, issuer_pem, issuer_key, issuer_key_pass=None, extensions="", days=30):
         """
         Signs the given CSR by the given issuer CA
 
@@ -189,8 +189,8 @@ class CryptographyService:
         :return: string containing the generated certificate in PEM format
         """
         csr = self.__create_csr(subject, subject_key, subject_key_pass=subject_key_pass)
-        return self._sign_csr(csr, issuer_pem, issuer_key, issuer_key_pass=issuer_key_pass, extensions=extensions,
-                              days=days)
+        return self.__sign_csr(csr, issuer_pem, issuer_key, issuer_key_pass=issuer_key_pass, extensions=extensions,
+                               days=days)
 
     @staticmethod
     def verify_cert(certificate):
diff --git a/proj/tests/services/cryptography/sign_csr_test.py b/proj/tests/services/cryptography/sign_csr_test.py
index 79cfed2..c448784 100644
--- a/proj/tests/services/cryptography/sign_csr_test.py
+++ b/proj/tests/services/cryptography/sign_csr_test.py
@@ -21,7 +21,7 @@ def test_sign_csr(service):
     csr = service._CryptographyService__create_csr(Subject(common_name="bar", country="CZ"), inter_key)
 
     # sign the created CSR with root CA
-    inter_ca = service._sign_csr(csr, root_ca, root_key)
+    inter_ca = service._CryptographyService__sign_csr(csr, root_ca, root_key)
 
     inter_ca_printed = export_crt(inter_ca)
 
@@ -41,7 +41,7 @@ def test_sign_csr_passphrase(service):
     csr = service._CryptographyService__create_csr(Subject(common_name="bar", country="CZ"), inter_key)
 
     # sign the created CSR with root CA and specify root key passphrase
-    inter_ca = service._sign_csr(csr, root_ca, root_key, issuer_key_pass=root_key_passphrase)
+    inter_ca = service._CryptographyService__sign_csr(csr, root_ca, root_key, issuer_key_pass=root_key_passphrase)
 
     inter_ca_printed = export_crt(inter_ca)
 
@@ -51,14 +51,15 @@ def test_sign_csr_passphrase(service):
 
     # try to sign it using a wrong passphrase
     with pytest.raises(CryptographyException) as e:
-        service._sign_csr(csr, root_ca, root_key,
-                          extensions="authorityInfoAccess = caIssuers;URI:bar.cz/baz.cert", issuer_key_pass="bazbaz")
+        service._CryptographyService__sign_csr(csr, root_ca, root_key,
+                                               extensions="authorityInfoAccess = caIssuers;URI:bar.cz/baz.cert",
+                                               issuer_key_pass="bazbaz")
     assert "bad decrypt" in e.value.message
 
     # try to sign it without specifying a passphrase
     with pytest.raises(CryptographyException) as e:
-        service._sign_csr(csr, root_ca, root_key,
-                          extensions="authorityInfoAccess = caIssuers;URI:bar.cz/baz.cert")
+        service._CryptographyService__sign_csr(csr, root_ca, root_key,
+                                               extensions="authorityInfoAccess = caIssuers;URI:bar.cz/baz.cert")
     assert "bad decrypt" in e.value.message
 
 
@@ -73,9 +74,9 @@ def test_sign_csr_extensions(service):
     csr = service._CryptographyService__create_csr(Subject(common_name="bar", country="CZ"), inter_key)
 
     # sign the created CSR with root CA and specify root key passphrase and specify extensions (AIA and CA)
-    inter_ca = service._sign_csr(csr, root_ca, root_key,
-                                 extensions="authorityInfoAccess = caIssuers;URI:bar.cz/baz/cert\nbasicConstraints=critical,CA:TRUE",
-                                 issuer_key_pass=root_key_passphrase)
+    inter_ca = service._CryptographyService__sign_csr(csr, root_ca, root_key,
+                                                      extensions="authorityInfoAccess = caIssuers;URI:bar.cz/baz/cert\nbasicConstraints=critical,CA:TRUE",
+                                                      issuer_key_pass=root_key_passphrase)
 
     inter_ca_printed = export_crt(inter_ca)
 
