diff options
-rw-r--r-- | cryptography/hazmat/primitives/interfaces.py | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index 11696160..4d9e7879 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -287,6 +287,99 @@ class RSAPublicKey(six.with_metaclass(abc.ABCMeta)): """ +class DSAParams(six.with_metaclass(abc.ABCMeta)): + @abc.abstractproperty + def modulus(self): + """ + The prime modulus that's used in generating the DSA keypair. + """ + + @abc.abstractproperty + def divisor(self): + """ + The prime divisor of (p-1) that's used in generating the DSA keypair. + """ + + @abc.abstractproperty + def generator(self): + """ + The generator that is used in generating the DSA keypair. + """ + + @abc.abstractmethod + def generate(self): + """ + Generate DSAPrivateKey from the object's parameters. + """ + + @abc.abstractproperty + def p(self): + """ + The prime modulus that's used in generating the DSA keypair. + Alias for modulus. + """ + + @abc.abstractproperty + def q(self): + """ + The prime divisor of (p-1) that's used in generating the DSA keypair. + Alias for divisor. + """ + + @abc.abstractproperty + def g(self): + """ + The generator that is used in generating the DSA keypair. + Alias for generator. + """ + + +class DSAPrivateKey(six.with_metaclass(abc.ABCMeta)): + @abc.abstractproperty + def key_size(self): + """ + The bit length of the prime modulus. + """ + + @abc.abstractmethod + def public_key(self): + """ + The DSAPublicKey associated with this private key. + """ + + @abc.abstractproperty + def x(self): + """ + The private key "x" in the DSA structure. + """ + + @abc.abstractproperty + def y(self): + """ + The integer value of y. + """ + + @abc.abstractproperty + def params(self): + """ + The DSAParams object associated with this private key. + """ + + +class DSAPublicKey(six.with_metaclass(abc.ABCMeta)): + @abc.abstractproperty + def y(self): + """ + The integer value of y. + """ + + @abc.abstractproperty + def params(self): + """ + The DSAParams object associated with this public key. + """ + + class AsymmetricSignatureContext(six.with_metaclass(abc.ABCMeta)): @abc.abstractmethod def update(self, data): |