diff options
Diffstat (limited to 'cryptography/hazmat')
-rw-r--r-- | cryptography/hazmat/primitives/interfaces.py | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py index 810a67a4..ef8566bd 100644 --- a/cryptography/hazmat/primitives/interfaces.py +++ b/cryptography/hazmat/primitives/interfaces.py @@ -489,3 +489,81 @@ class CMACContext(object): """ Return a CMACContext that is a copy of the current context. """ + + +class EllipticCurve(six.with_metaclass(abc.ABCMeta)): + @abc.abstractproperty + def name(self): + """ + The name of the curve. e.g. secp256r1. + """ + + @abc.abstractproperty + def key_size(self): + """ + The bit length of the base point of the curve. + """ + + +class EllipticCurvePrivateKey(six.with_metaclass(abc.ABCMeta)): + @abc.abstractproperty + def curve(self): + """ + The EllipticCurve that this key is on. + """ + + @abc.abstractproperty + def private_key(self): + """ + The private value used for signing. + """ + + @abc.abstractproperty + def key_size(self): + """ + The bit length of the base point of the curve. + """ + + @abc.abstractproperty + def x(self): + """ + The affine x component of the public point used for verifying. + """ + + @abc.abstractproperty + def y(self): + """ + The affine y component of the public point used for verifying. + """ + + @abc.abstractmethod + def public_key(self): + """ + The ECDSAPublicKey for this private key. + """ + + +class EllipticCurvePublicKey(six.with_metaclass(abc.ABCMeta)): + @abc.abstractproperty + def curve(self): + """ + The EllipticCurve that this key is on. + """ + + @abc.abstractproperty + def x(self): + """ + The affine x component of the public point used for verifying. + """ + + @abc.abstractproperty + def y(self): + """ + The affine y component of the public point used for verifying. + """ + + @abc.abstractproperty + def key_size(self): + """ + The bit length of the base point of the curve. + """ |