mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-15 20:40:20 +00:00
add missing methods to DH interfaces (#3719)
This commit is contained in:
parent
361a9fc2b7
commit
653cfe8720
1 changed files with 18 additions and 0 deletions
|
|
@ -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.
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue