aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography/hazmat/primitives/hmac.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-10-25 13:44:14 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2014-10-25 13:44:14 -0700
commitbf148d2e11e3fbf95ce6213eb3722a4911a3f4ff (patch)
treee8b9285e0a93f165380e2be0d72cf7700f7eb2ca /cryptography/hazmat/primitives/hmac.py
parentdaca59235c6be9ae11044aa8bb14e137c0435dd2 (diff)
downloadcryptography-bf148d2e11e3fbf95ce6213eb3722a4911a3f4ff.tar.gz
cryptography-bf148d2e11e3fbf95ce6213eb3722a4911a3f4ff.tar.bz2
cryptography-bf148d2e11e3fbf95ce6213eb3722a4911a3f4ff.zip
Expose all attributes via properties so they can be statically introspected
Refs #1424
Diffstat (limited to 'cryptography/hazmat/primitives/hmac.py')
-rw-r--r--cryptography/hazmat/primitives/hmac.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/cryptography/hazmat/primitives/hmac.py b/cryptography/hazmat/primitives/hmac.py
index b85fb2aa..22a31391 100644
--- a/cryptography/hazmat/primitives/hmac.py
+++ b/cryptography/hazmat/primitives/hmac.py
@@ -33,7 +33,7 @@ class HMAC(object):
if not isinstance(algorithm, interfaces.HashAlgorithm):
raise TypeError("Expected instance of interfaces.HashAlgorithm.")
- self.algorithm = algorithm
+ self._algorithm = algorithm
self._backend = backend
self._key = key
@@ -42,6 +42,8 @@ class HMAC(object):
else:
self._ctx = ctx
+ algorithm = utils.read_only_property("_algorithm")
+
def update(self, data):
if self._ctx is None:
raise AlreadyFinalized("Context was already finalized.")