diff options
-rw-r--r-- | cryptography/hazmat/backends/interfaces.py | 6 | ||||
-rw-r--r-- | docs/hazmat/backends/interfaces.rst | 14 |
2 files changed, 20 insertions, 0 deletions
diff --git a/cryptography/hazmat/backends/interfaces.py b/cryptography/hazmat/backends/interfaces.py index da41532d..27b609ed 100644 --- a/cryptography/hazmat/backends/interfaces.py +++ b/cryptography/hazmat/backends/interfaces.py @@ -106,6 +106,12 @@ class RSABackend(six.with_metaclass(abc.ABCMeta)): interface. """ + @abc.abstractmethod + def mgf1_hash_supported(self, algorithm): + """ + Return True if the hash algorithm is supported for MGF1 in PSS. + """ + class OpenSSLSerializationBackend(six.with_metaclass(abc.ABCMeta)): @abc.abstractmethod diff --git a/docs/hazmat/backends/interfaces.rst b/docs/hazmat/backends/interfaces.rst index a7a9661b..c3ea164a 100644 --- a/docs/hazmat/backends/interfaces.rst +++ b/docs/hazmat/backends/interfaces.rst @@ -249,6 +249,20 @@ A specific ``backend`` may provide one or more of these interfaces. :returns: :class:`~cryptography.hazmat.primitives.interfaces.AsymmetricVerificationContext` + .. method:: mgf1_hash_supported(algorithm) + + Check if the specified ``algorithm`` is supported for use with + :class:`~cryptography.hazmat.primitives.asymmetric.padding.MGF1` + inside :class:`~cryptography.hazmat.primitives.asymmetric.padding.PSS` + padding. + + :param algorithm: An instance of a + :class:`~cryptography.hazmat.primitives.interfaces.HashAlgorithm` + provider. + + :returns: ``True`` if the specified ``algorithm`` is supported by this + backend, otherwise ``False``. + .. class:: OpenSSLSerializationBackend |