diff options
author | Aviv Palivoda <palaviv@gmail.com> | 2016-07-02 19:43:06 +0300 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2016-07-02 12:43:06 -0400 |
commit | 2120a8e090ff8974d727f76aae5f2f9eac56656c (patch) | |
tree | c79d3eaac5584d05bead50f516e5f5dac0cd4bea /src/cryptography/hazmat/primitives/asymmetric | |
parent | 14a9ad4c35a625088339e2e142907243adfffa99 (diff) | |
download | cryptography-2120a8e090ff8974d727f76aae5f2f9eac56656c.tar.gz cryptography-2120a8e090ff8974d727f76aae5f2f9eac56656c.tar.bz2 cryptography-2120a8e090ff8974d727f76aae5f2f9eac56656c.zip |
One shot sign/verification ECDSA (#3029)
* Add sign and verify methods to ECDSA
* Documented ECDSA sign/verify methods
* Added CHANGELOG entry
* Skipping test verify and sign if curve is not supported
* Fixed typo in documentation return type
* Removed provider language from EllipticCurvePrivateKey and EllipticCurvePublicKey
Diffstat (limited to 'src/cryptography/hazmat/primitives/asymmetric')
-rw-r--r-- | src/cryptography/hazmat/primitives/asymmetric/ec.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/primitives/asymmetric/ec.py b/src/cryptography/hazmat/primitives/asymmetric/ec.py index 907a6358..1c576c6d 100644 --- a/src/cryptography/hazmat/primitives/asymmetric/ec.py +++ b/src/cryptography/hazmat/primitives/asymmetric/ec.py @@ -62,6 +62,12 @@ class EllipticCurvePrivateKey(object): The EllipticCurve that this key is on. """ + @abc.abstractproperty + def sign(self, data, signature_algorithm): + """ + Signs the data + """ + @six.add_metaclass(abc.ABCMeta) class EllipticCurvePrivateKeyWithSerialization(EllipticCurvePrivateKey): @@ -104,6 +110,12 @@ class EllipticCurvePublicKey(object): Returns the key serialized as bytes. """ + @abc.abstractmethod + def verify(self, signature, data, signature_algorithm): + """ + Verifies the signature of the data. + """ + EllipticCurvePublicKeyWithSerialization = EllipticCurvePublicKey |