add missing methods to DH interfaces (#3719)

This commit is contained in:
Paul Kehrer 2017-06-24 10:12:18 -10:00 committed by Alex Gaynor
parent 361a9fc2b7
commit 653cfe8720

View file

@ -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.
"""