Эх сурвалжийг харах

add a Signing.has_private flag

Malte Kraus 8 жил өмнө
parent
commit
2c36aaabfd
1 өөрчлөгдсөн 7 нэмэгдсэн , 0 устгасан
  1. 7 0
      src/crypto.py

+ 7 - 0
src/crypto.py

@@ -73,3 +73,10 @@ class Signing:
     def __hash__(self):
         return hash((self.rsa.e, self.rsa.n))
 
+    @property
+    def has_private(self) -> bool:
+        """
+        Returns a bool value indicating whether this instance has a private key that can be used to
+        sign things.
+        """
+        return self.rsa.has_private()