aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cryptography/hazmat/primitives/asymmetric/dh.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/primitives/asymmetric/dh.py b/src/cryptography/hazmat/primitives/asymmetric/dh.py
index d5e82606..fc1317f0 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/dh.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/dh.py
@@ -123,6 +123,12 @@ class DHParameters(object):
Generates and returns a DHPrivateKey.
"""
+ @abc.abstractmethod
+ def parameter_bytes(self, encoding, format):
+ """
+ Returns the parameters serialized as bytes.
+ """
+
@six.add_metaclass(abc.ABCMeta)
class DHParametersWithSerialization(DHParameters):
@@ -169,6 +175,12 @@ class DHPrivateKeyWithSerialization(DHPrivateKey):
Returns a DHPrivateNumbers.
"""
+ @abc.abstractmethod
+ def private_bytes(self, encoding, format, encryption_algorithm):
+ """
+ Returns the key serialized as bytes.
+ """
+
@six.add_metaclass(abc.ABCMeta)
class DHPublicKey(object):
@@ -192,3 +204,9 @@ class DHPublicKeyWithSerialization(DHPublicKey):
"""
Returns a DHPublicNumbers.
"""
+
+ @abc.abstractmethod
+ def public_bytes(self, encoding, format):
+ """
+ Returns the key serialized as bytes.
+ """