aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorAlex Stapleton <alexs@prol.etari.at>2014-04-01 16:18:17 +0100
committerAlex Stapleton <alexs@prol.etari.at>2014-05-23 21:05:47 +0100
commit085f37861e4a505a12a1ddb940788a3025fdcf4f (patch)
tree2ab276e9b5778f137b3418729b8beb667498461e /cryptography
parentebf1235e7ebbd84d2f1e05a060c6df25adb58353 (diff)
downloadcryptography-085f37861e4a505a12a1ddb940788a3025fdcf4f.tar.gz
cryptography-085f37861e4a505a12a1ddb940788a3025fdcf4f.tar.bz2
cryptography-085f37861e4a505a12a1ddb940788a3025fdcf4f.zip
Elliptic curve interfaces
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/hazmat/primitives/interfaces.py78
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.
+ """