Browse Source

Make REGISTERED_TYPES public

This change makes the _REGISTERED_TYPES member
of the signature_utils object public so that it
can be referenced by Nova.

Change-Id: Ia1615dcd4ca20702693b6c5ebddc472fe29f224c
dane-fichter 2 years ago
parent
commit
fac14bcac3
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      cursive/signature_utils.py

+ 6
- 6
cursive/signature_utils.py View File

@@ -81,7 +81,7 @@ MASK_GEN_ALGORITHMS = {
81 81
 
82 82
 class SignatureKeyType(object):
83 83
 
84
-    _REGISTERED_TYPES = {}
84
+    REGISTERED_TYPES = {}
85 85
 
86 86
     def __init__(self, name, public_key_type, create_verifier):
87 87
         self.name = name
@@ -96,9 +96,9 @@ class SignatureKeyType(object):
96 96
         :param public_key_type: e.g. RSAPublicKey, DSAPublicKey, etc.
97 97
         :param create_verifier: a function to create a verifier for this type
98 98
         """
99
-        cls._REGISTERED_TYPES[name] = cls(name,
100
-                                          public_key_type,
101
-                                          create_verifier)
99
+        cls.REGISTERED_TYPES[name] = cls(name,
100
+                                         public_key_type,
101
+                                         create_verifier)
102 102
 
103 103
     @classmethod
104 104
     def lookup(cls, name):
@@ -108,10 +108,10 @@ class SignatureKeyType(object):
108 108
         :returns: the SignatureKeyType object
109 109
         :raises: SignatureVerificationError if signature key type is invalid
110 110
         """
111
-        if name not in cls._REGISTERED_TYPES:
111
+        if name not in cls.REGISTERED_TYPES:
112 112
             raise exception.SignatureVerificationError(
113 113
                 reason=_('Invalid signature key type: %s') % name)
114
-        return cls._REGISTERED_TYPES[name]
114
+        return cls.REGISTERED_TYPES[name]
115 115
 
116 116
 
117 117
 # each key type will require its own verifier

Loading…
Cancel
Save