aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/hazmat/primitives/asymmetric
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2017-06-24 10:12:18 -1000
committerAlex Gaynor <alex.gaynor@gmail.com>2017-06-24 16:12:18 -0400
commit653cfe872052b641bbfdf84a97b330a479a7b4fc (patch)
tree4262156a9d85bfb91ac3e01d3eae6aad4ba2b5b9 /src/cryptography/hazmat/primitives/asymmetric
parent361a9fc2b7ec3c41dbf479071fca87a2573e0c52 (diff)
downloadcryptography-653cfe872052b641bbfdf84a97b330a479a7b4fc.tar.gz
cryptography-653cfe872052b641bbfdf84a97b330a479a7b4fc.tar.bz2
cryptography-653cfe872052b641bbfdf84a97b330a479a7b4fc.zip
add missing methods to DH interfaces (#3719)
Diffstat (limited to 'src/cryptography/hazmat/primitives/asymmetric')
-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.
+ """