diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2019-01-20 15:02:59 -0600 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2019-01-20 15:02:59 -0600 |
commit | a07b1f5463361570c3248c1096ffd8b3bff0bfa5 (patch) | |
tree | 66bc3e076557579ad062dea6a08a716519857b11 /docs/hazmat | |
parent | 5fe88ea0500c6e418492f4b166c0d4a24e9632cc (diff) | |
download | cryptography-a07b1f5463361570c3248c1096ffd8b3bff0bfa5.tar.gz cryptography-a07b1f5463361570c3248c1096ffd8b3bff0bfa5.tar.bz2 cryptography-a07b1f5463361570c3248c1096ffd8b3bff0bfa5.zip |
add support for encoding compressed points (#4638)
* add support for encoding compressed points
* review feedback
Diffstat (limited to 'docs/hazmat')
-rw-r--r-- | docs/hazmat/primitives/asymmetric/ec.rst | 16 | ||||
-rw-r--r-- | docs/hazmat/primitives/asymmetric/serialization.rst | 22 |
2 files changed, 34 insertions, 4 deletions
diff --git a/docs/hazmat/primitives/asymmetric/ec.rst b/docs/hazmat/primitives/asymmetric/ec.rst index bd618551..a356dcaa 100644 --- a/docs/hazmat/primitives/asymmetric/ec.rst +++ b/docs/hazmat/primitives/asymmetric/ec.rst @@ -668,12 +668,20 @@ Key Interfaces .. method:: public_bytes(encoding, format) - Allows serialization of the key to bytes. Encoding ( - :attr:`~cryptography.hazmat.primitives.serialization.Encoding.PEM` or + Allows serialization of the key data to bytes. When encoding the public + key the encodings ( + :attr:`~cryptography.hazmat.primitives.serialization.Encoding.PEM`, :attr:`~cryptography.hazmat.primitives.serialization.Encoding.DER`) and format ( :attr:`~cryptography.hazmat.primitives.serialization.PublicFormat.SubjectPublicKeyInfo`) - are chosen to define the exact serialization. + are chosen to define the exact serialization. When encoding the point + the encoding + :attr:`~cryptography.hazmat.primitives.serialization.Encoding.X962` + should be used with the formats ( + :attr:`~cryptography.hazmat.primitives.serialization.PublicFormat.UncompressedPoint` + or + :attr:`~cryptography.hazmat.primitives.serialization.PublicFormat.CompressedPoint` + ). :param encoding: A value from the :class:`~cryptography.hazmat.primitives.serialization.Encoding` enum. @@ -681,7 +689,7 @@ Key Interfaces :param format: A value from the :class:`~cryptography.hazmat.primitives.serialization.PublicFormat` enum. - :return bytes: Serialized key. + :return bytes: Serialized data. .. method:: verify(signature, data, signature_algorithm) diff --git a/docs/hazmat/primitives/asymmetric/serialization.rst b/docs/hazmat/primitives/asymmetric/serialization.rst index 4c2e5f2a..87a6372c 100644 --- a/docs/hazmat/primitives/asymmetric/serialization.rst +++ b/docs/hazmat/primitives/asymmetric/serialization.rst @@ -536,6 +536,20 @@ Serialization Formats A raw format used by :doc:`/hazmat/primitives/asymmetric/x448`. It is a binary format and is invalid for other key types. + .. attribute:: CompressedPoint + + .. versionadded:: 2.5 + + A compressed elliptic curve public key as defined in ANSI X9.62 section + 4.3.6 (as well as `SEC 1 v2.0`_). + + .. attribute:: UncompressedPoint + + .. versionadded:: 2.5 + + An uncompressed elliptic curve public key as defined in ANSI X9.62 + section 4.3.6 (as well as `SEC 1 v2.0`_). + .. class:: ParameterFormat .. versionadded:: 2.0 @@ -594,6 +608,13 @@ Serialization Encodings A raw format used by :doc:`/hazmat/primitives/asymmetric/x448`. It is a binary format and is invalid for other key types. + .. attribute:: X962 + + .. versionadded:: 2.5 + + The format used by elliptic curve point encodings. This is a binary + format. + Serialization Encryption Types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -626,3 +647,4 @@ Serialization Encryption Types .. _`PKCS3`: https://www.emc.com/emc-plus/rsa-labs/standards-initiatives/pkcs-3-diffie-hellman-key-agreement-standar.htm +.. _`SEC 1 v2.0`: http://www.secg.org/sec1-v2.pdf |