@@ -73,6 +73,7 @@ There are four test suites, three for the original Pearson module, and one
73
73
more for the wrapper. To run them all, do this:
74
74
75
75
python setup.py test
76
+ tox -e coverage
76
77
77
78
On my 2014 Mac Mini, the combined tests take about 20 seconds to run. On a
78
79
2.4GHz P4 Linux box, they take 81 seconds.
@@ -118,7 +119,8 @@ is to call `s=sk.to_string()`, and then re-create it with
118
119
` SigningKey.from_string(s, curve) ` . This short form does not record the
119
120
curve, so you must be sure to tell from_string() the same curve you used for
120
121
the original key. The short form of a NIST192p-based signing key is just 24
121
- bytes long.
122
+ bytes long. If the point encoding is invalid or it does not lie on the
123
+ specified curve, ` from_string() ` will raise MalformedPointError.
122
124
123
125
from ecdsa import SigningKey, NIST384p
124
126
sk = SigningKey.generate(curve=NIST384p)
@@ -132,7 +134,8 @@ formats that OpenSSL uses. The PEM file looks like the familiar ASCII-armored
132
134
is a shorter binary form of the same data.
133
135
` SigningKey.from_pem()/.from_der() ` will undo this serialization. These
134
136
formats include the curve name, so you do not need to pass in a curve
135
- identifier to the deserializer.
137
+ identifier to the deserializer. In case the file is malformed ` from_der() `
138
+ and ` from_pem() ` will raise UnexpectedDER or MalformedPointError.
136
139
137
140
from ecdsa import SigningKey, NIST384p
138
141
sk = SigningKey.generate(curve=NIST384p)
0 commit comments