From 12c8c2ce1adc7a4f365df26961affdb69a5723c3 Mon Sep 17 00:00:00 2001 From: mccoyp Date: Mon, 11 Sep 2023 15:30:26 -0700 Subject: [PATCH] Add properties --- .../hazmat/primitives/asymmetric/padding.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/cryptography/hazmat/primitives/asymmetric/padding.py b/src/cryptography/hazmat/primitives/asymmetric/padding.py index 61359adfa9b5..b4babf44f79b 100644 --- a/src/cryptography/hazmat/primitives/asymmetric/padding.py +++ b/src/cryptography/hazmat/primitives/asymmetric/padding.py @@ -56,6 +56,10 @@ def __init__( self._salt_length = salt_length + @property + def mgf(self) -> MGF: + return self._mgf + class OAEP(AsymmetricPadding): name = "EME-OAEP" @@ -73,6 +77,14 @@ def __init__( self._algorithm = algorithm self._label = label + @property + def algorithm(self) -> hashes.HashAlgorithm: + return self._algorithm + + @property + def mgf(self) -> MGF: + return self._mgf + class MGF(metaclass=abc.ABCMeta): _algorithm: hashes.HashAlgorithm