aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-10-27 22:17:13 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-10-27 22:17:13 -0400
commitd3f4ecdbefe20f4f9cb8b74701c5757557e476e1 (patch)
tree7bd4e100c3536859936c6453208f956719f1d7c5 /docs
parentcab8db3e9535a3900602931cb84d3f273f685d47 (diff)
parent197db3367ceecdbaf0adc5eaa9339b934b10acfe (diff)
downloadcryptography-d3f4ecdbefe20f4f9cb8b74701c5757557e476e1.tar.gz
cryptography-d3f4ecdbefe20f4f9cb8b74701c5757557e476e1.tar.bz2
cryptography-d3f4ecdbefe20f4f9cb8b74701c5757557e476e1.zip
Merge pull request #2447 from reaperhulk/encode-decode-point
add support for encoding/decoding elliptic curve points
Diffstat (limited to 'docs')
-rw-r--r--docs/hazmat/primitives/asymmetric/ec.rst32
1 files changed, 32 insertions, 0 deletions
diff --git a/docs/hazmat/primitives/asymmetric/ec.rst b/docs/hazmat/primitives/asymmetric/ec.rst
index 90e73711..c1619dd0 100644
--- a/docs/hazmat/primitives/asymmetric/ec.rst
+++ b/docs/hazmat/primitives/asymmetric/ec.rst
@@ -122,6 +122,37 @@ Elliptic Curve Signature Algorithms
:returns: A new instance of a :class:`EllipticCurvePublicKey`
provider.
+ .. method:: encode_point()
+
+ .. versionadded:: 1.1
+
+ Encodes an elliptic curve point to a byte string as described in
+ `SEC 1 v2.0`_ section 2.3.3. This method only supports uncompressed
+ points.
+
+ :return bytes: The encoded point.
+
+ .. classmethod:: from_encoded_point(curve, data)
+
+ .. versionadded:: 1.1
+
+ Decodes a byte string as described in `SEC 1 v2.0`_ section 2.3.3 and
+ returns an :class:`EllipticCurvePublicNumbers`. This method only
+ supports uncompressed points.
+
+ :param curve: An
+ :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve`
+ instance.
+
+ :param bytes data: The serialized point byte string.
+
+ :returns: An :class:`EllipticCurvePublicNumbers` instance.
+
+ :raises ValueError: Raised on invalid point type or data length.
+
+ :raises TypeError: Raised when curve is not an
+ :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve`.
+
Elliptic Curve Key Exchange algorithm
-------------------------------------
@@ -478,3 +509,4 @@ Key Interfaces
.. _`ECDSA`: https://en.wikipedia.org/wiki/ECDSA
.. _`EdDSA`: https://en.wikipedia.org/wiki/EdDSA
.. _`forward secrecy`: https://en.wikipedia.org/wiki/Forward_secrecy
+.. _`SEC 1 v2.0`: http://www.secg.org/sec1-v2.pdf